So I included both of my external HDD-s to /etc/fstab, so automounting is easy (mount -a). Once that is done, I move files that I don't need on my laptop to the external 80GB drive. Then I run the backup script:
.backup.sh
sudo sh -c "
rsync -av --delete-excluded --exclude-from=.backup.lst / /media/backup/;
touch /media/backup/BACKUP
"Backup is done using the program called rsync. What the script does is it is taking every file from root folder recursively (/) and copying it to /media/backup/ folder that is the mountpoint of my 256GB external HDD. The script will exclude every file included in .backup.lst file (there sould be definitely an entry for the mountpoint of the backup drive to avoid infinite loop, in my case /media/backup/):
.backup.lst
#Include
+ /dev/console
+ /dev/initctl
+ /dev/null
+ /dev/zero
#Exclude
- /dev/*
- /proc/*
- /sys/*
- /tmp/*
- lost+found/
- /media/backup/*
Usually the locations that contain runtime data for the operating system are excluded.
So the simple steps to backing up my data include:
1) connect the external drives to laptop
2) mount -a
3) move neccesary files to 80GB drive
4)./.backup.sh
and done.
No comments:
Post a Comment