Mention prepare-source script and make branches clearer.
[rsync-web.git] / susan.txt
1 I use rsync to backup my wifes home directory across a modem link each
2 night. The cron job looks like this
3
4     #!/bin/sh
5     cd ~susan
6     {
7     echo
8     date
9     dest=~/backup/`date +%A`
10     mkdir $dest.new
11     find . -xdev -type f \( -mtime 0 -or -mtime 1 \) -exec cp -aPv "{}"
12     $dest.new \;
13     cnt=`find $dest.new -type f | wc -l`
14     if [ $cnt -gt 0 ]; then
15       rm -rf $dest
16       mv $dest.new $dest
17     fi
18     rm -rf $dest.new
19     rsync -Cavze ssh . samba:backup
20     } >> ~/backup/backup.log 2>&1
21
22
23 note that most of this script isn't anything to do with rsync, it just
24 creates a daily backup of Susans work in a ~susan/backup/ directory so
25 she can retrieve any version from the last week. The last line does
26 the rsync of her directory across the modem link to the host
27 samba. Note that I am using the -C option which allows me to add
28 entries to .cvsignore for stuff that doesn't need to be backed up.
29
30
31