[luau] thumb drive, incremental backup

Hawaii Linux Institute wp at HawaiiLinux.us
Wed Oct 1 20:56:01 PDT 2003


If you're as paranoid as I am about not being able to timely back up any 
important files, you can use the following template as a starting point 
to write your own incremental-backup script:

%!/bin/sh
BACKUP_DATE=`date +%y%m%d`
find /home/xxxxx -mtime -7 -type f -print > backup.weekly
tar -cvz -T backup.weekly -f backup.weekly.$BACKUP_DATE.tgz


Comment: you can put an ampersand at the end of each line (but separated 
by a space) so the process will be done in the background.  But I like 
to see what's going on when I do the backups.

The above script will backup all the files in your own home directory 
(replacing "xxxxx" with your own home directory) that have been modified 
in the past 7 days, compress them, and save the compressed tarball into 
a file called backup.weekly.031001.tgz . (031001 being today's date.)

For daily backups, of course, simply change "-mtime -7"  to "-mtime -1" 
(and "weekly" to "daily").  You can run this daily backup script as 
frequently as you feel paranoid.  Old daily backup files will be 
continuouly updated, until your computer clock moves to a new date.  
Then your daily backup file (of the previous day) becomes final.




More information about the LUAU mailing list