3 # Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
5 # This program is distributable under the terms of the GNU GPL (see
8 # Test that the --backup option works right.
10 . "$suitedir/rsync.fns"
14 mkdir "$fromdir" "$bakdir"
15 name1="$fromdir/name1"
16 name2="$fromdir/name2"
17 echo "This is the file" > "$name1"
18 echo "This is the other file" > "$name2"
20 checkit "$RSYNC -avv --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
22 $RSYNC -avv --backup "$todir/" "$chkdir/"
24 echo "Extending the file" >> "$name1"
25 echo "Extending the other file" >> "$name2"
27 checkit "$RSYNC -avv --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
29 diff -r $diffopt "$chkdir" "$bakdir"
31 echo "Extending the file again" >> "$name1"
32 echo "Extending the other file again" >> "$name2"
34 checkit "$RSYNC -avv --inplace --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
36 diff -r $diffopt "$chkdir" "$bakdir"
38 # The script would have aborted on error, so getting here means we've won.