-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A simple test of the backup functionality.
- Loading branch information
Wayne Davison
committed
Sep 20, 2004
1 parent
9715c58
commit 7d059d4
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! /bin/sh | ||
|
||
# Copyright (C) 2004 by Wayne Davison <wayned@samba.org> | ||
|
||
# This program is distributable under the terms of the GNU GPL (see | ||
# COPYING). | ||
|
||
# Test that the --backup option works right. | ||
|
||
. "$suitedir/rsync.fns" | ||
|
||
bakdir="$tmpdir/chk" | ||
|
||
mkdir "$fromdir" "$bakdir" | ||
name1="$fromdir/name1" | ||
name2="$fromdir/name2" | ||
echo "This is the file" > "$name1" | ||
echo "This is the other file" > "$name2" | ||
|
||
checkit "$RSYNC -avv --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir" | ||
|
||
$RSYNC -avv --backup "$todir/" "$chkdir/" | ||
|
||
echo "Extending the file" >> "$name1" | ||
echo "Extending the other file" >> "$name2" | ||
|
||
checkit "$RSYNC -avv --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir" | ||
|
||
diff -ru "$chkdir" "$bakdir" | ||
|
||
echo "Extending the file again" >> "$name1" | ||
echo "Extending the other file again" >> "$name2" | ||
|
||
checkit "$RSYNC -avv --inplace --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir" | ||
|
||
diff -ru "$chkdir" "$bakdir" | ||
|
||
# The script would have aborted on error, so getting here means we've won. | ||
exit 0 |