You are not logged in.
Pages: 1
Is there something like this that will backup all the system config files, and any others that you would want? It'd have to be something like reading from a text file, that has a list of files to backup, So that you can add any other files you wanted. Is there already something like that? Or would I have to make it myself, and if I did, what language should I use, and how would I go about it? I don't know much programming, but I can learn. This might be a good project. What do y'all think?
Offline
This is what I do, please modify it according to your needs and I'm sure there are others who are better at scripting than me here who will be able to provide you with better scripts. take this just as an example.
#!/bin/bash
echo " Backup Process started!"
echo " Please wait..."
mkdir -v /windows/Linux-Backup
cp -R /home/shy/.config/* /windows/Linux-Backup
cp /home/shy/.info.pl /windows/Linux-Backup
cp /home/shy/.notify.py /windows/Linux-Backup
cp /home/shy/.weather.sh /windows/Linux-Backup
cp /etc/X11/xorg.conf /windows/Linux-Backup
cp /boot/grub/menu.lst /windows/Linux-Backup
cp /etc/pacman.conf /windows/Linux-Backup
cp /etc/pacman.d/mirrorlist /windows/Linux-Backup
cp -R /home/shy/.scripts /windows/Linux-Backup
cp -R /home/shy/Scripts /windows/Linux-Backup
cp -R /home/shy/Backups /windows/Linux-Backup
cp -R /home/shy/.mozilla /windows/Linux-Backup
cp /home/shy/.xinitrc /windows/Linux-Backup
cp /home/shy/.Xdefaults /windows/Linux-Backup
cp /home/shy/.conk* /windows/Linux-Backup
cp /home/shy/.gtkrc* /windows/Linux-Backup
cp /home/shy/.bashrc /windows/Linux-Backup
echo " Backup Process Complete!"
sleep 2 && echo " Shutting Down....."
echo
Save as backup.sh
And then this:
#!/bin/bash
## Script to call backup.sh
echo " Do you want to BackUp your System now ? (y/n) : "
read now
case "$now" in
[nN]*) echo " BackUp Cancelled!" ;;
[yY]*) backup.sh ;;
*) echo " BackUp Terminated by default! Bad option!"
esac
Save as backupcall.sh
# chmod +x backup.sh
# chmod +x backupcall.sh
# cp backupcall.sh /usr/bin
# cp backup.sh /usr/bin
You may want to put it in /etc/rc.local.shutdown
#!/bin/bash
backupcall.sh
Please note that everytime you shutdown the script will ask your confirmation. This is really not needed, but I like it this way for being safe.:P You can ignore the last step and just type in terminal backupcall and it will run the script. You can also add it in cron as a daily job.
Last edited by sHyLoCk (2009-09-16 15:03:55)
Offline
Cool! Thanks!
Is there a list somewhere of all the config files on the system?
Offline
Try these ones:
http://www.seiichiro0185.org/doku.php/l … kupscripts
There are two scripts, one for home directories backup which copy the changed and new files of the given homedir to the backupdir and one which do a full system backup and save it into a tar.gz.
The configuration is done in the script and very easy if you have some questions about it just ask.
Website: andrwe.org
Repository: repo.andrwe.org/<archtiecture>
Offline
It'd have to be something like reading from a text file, that has a list of files to backup, So that you can add any other files you wanted. Is there already something like that?
http://aur.archlinux.org/packages.php?ID=26777
Even maintains a rolling daily, weekly, monthly copy of your backups
Last edited by fukawi2 (2009-09-16 22:35:02)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
You could also give rdiff-backup a try.
My (simple) script:
su -c "rdiff-backup \
--preserve-numerical-ids \
--include-globbing-filelist archbackup \
-v5 \
/ /mnt/backups/$(uname -n)"
archbackup file:
- **/lost+found
+ /boot/grub/grub.cfg
+ /etc
+ /home/xduugu
+ /srv/http
+ /var/lib/pacman/local
- /
Offline
I write a package inventory to a file in /etc, and then save /boot/grub/menu.lst, /etc and my home directory to an encrypted USB disk using rsync:
#!/bin/bash
if [ `id -u` != "0" ] ; then
echo "You must be root"
exit 1
fi
logger -t backup "backup started"
cryptsetup luksOpen /dev/rawbackup lb
mount /dev/mapper/lb /backup || exit 3
pacman -Qqe > /etc/pkglist.txt
sync
rsync -aiPRAX --delete \
/boot/grub/menu.lst \
/etc/ \
/home/ataraxia \
/backup/rsync
sync
umount /backup
cryptsetup luksClose lb
logger -t backup "backup finished"
/dev/rawbackup is created by a udev rule based on the serial number of the backup disk.
Last edited by ataraxia (2009-09-17 02:33:01)
Offline
Pages: 1