RSYNC


In general, your files are NOT backed-up. Be assured that harddisks DO crash. To avoid loss of weeks or months of work you should make sure to back-up stuff yourself. An example for (almost) brute force automated nightly back-up is given here:

I.  Create a file c1
In c1 type the rsync commands to create your backup.
Here is an example for backing up /my_disk/my_uname/my_data on /backup_disk/my_uname/data_backup (where /backup_disk might be e.g. /raid7).
Note: You will need to create the proper directory structure first.

(1) Get rid of old backup log file:
rm -f  /backup_disk/my_uname/Rsync_logs/data_backup_old.asc

(2) Move current backup log file to old.
mv -f   /backup_disk/my_uname/Rsync_logs/data_backup.asc   /backup_disk/my_uname/Rsync_logs/data_backup_old.asc

(3) use rsync to create backup.
rsync -avzu --delete --force --stats /my_disk/my_uname/my_data/   /backup_disk/my_uname/data_backup

(4) chmod
chmod  700  /backup_disk/my_uname/data_backup

Note: the --delete switch means that files that have been removed will be deleted in the new backup.
If you do not wish this to happen (e.g. in case you want to recover old files), remove the --delete switch. However, in this case you need to keep an eye
on your backup so it does not fill up the disk, preventing new data from being backed up.

Another useful switch is --exclude-from which allows you to exclude directories that you do not wish to back-up (e.g. large data sets that are easily replaceable). The syntax is --exclude-from=/path/to/file/which/lists/excluded/files/and/directories.

See the man page for additional possible switches.


II  Create a file table.asc
Enter the time you wish the backup to be taken. You probably also want to add some comments saying what the file is:
# crontab
# reiprich 2004-11-30
# Load: crontab table.asc
# List: crontab -l
#min   hour   day   month   dow   command
22      02           *         *           *     /your/path/to/c1

The "*" indicates it should be done every day, month, and day of the week.

Type: crontab table.asc
and you're done!

Examples
You can find further examples of rsync commands here:
/aibn154_a/reiprich/Programming/cron/c1


Example cron tab for automated execution:
/aibn154_a/reiprich/Programming/cron/table.asc




Return to Software Page

Return to Main Page