mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 11:55:01 +01:00
e71b252b65
Before this change, Bisync did not check to make sure that Path1 and Path2 do not overlap, nor did it check for overlaps with `--backup-dir`. While `sync` does check for these things, it can sometimes be fooled because of the way Bisync calls it with `--files-from` filters. Relying on sync could also leave a run in a half-finished state if it were to error in one direction but not the other (`--backup-dir` only checks for overlaps with the dest.) After this change, Bisync does its own check up front, so we can quickly return an error and exit before any changes are made.
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
test backupdir
|
|
# Exercise all of the various file change scenarios
|
|
# - New on Path2 file10
|
|
# - Newer on Path2 file1
|
|
# - New on Path1 file11
|
|
# - Newer on Path1 file2
|
|
# - Deleted on Path2 file3
|
|
# - Deleted on Path1 file4
|
|
# - Changed on Path2 and on Path1 file5 (file5r, file5l)
|
|
# - Newer on Path2 and deleted on Path1 file6
|
|
# - Newer on Path1 and deleted on Path2 file7
|
|
# - Deleted on both paths file8
|
|
|
|
test initial bisync
|
|
bisync resync backupdir1={workdir/}backupdirs/backupdir1 backupdir2={workdir/}backupdirs/backupdir2
|
|
|
|
test make modifications on both paths
|
|
test new on path2 - file10
|
|
touch-copy 2001-01-02 {datadir/}file10.txt {path2/}
|
|
|
|
test newer on path2 - file1
|
|
touch-copy 2001-01-02 {datadir/}file1.txt {path2/}
|
|
|
|
test new on path1 - file11
|
|
touch-copy 2001-01-02 {datadir/}file11.txt {path1/}
|
|
|
|
test newer on path1 - file2
|
|
touch-copy 2001-01-02 {datadir/}file2.txt {path1/}
|
|
|
|
test deleted on path2 - file3
|
|
delete-file {path2/}file3.txt
|
|
|
|
test deleted on path1 - file4
|
|
delete-file {path1/}file4.txt
|
|
|
|
test deleted on both paths - file8
|
|
delete-file {path1/}file8.txt
|
|
delete-file {path2/}file8.txt
|
|
|
|
test changed on both paths - file5 (file5R, file5L)
|
|
touch-glob 2001-01-02 {datadir/} file5R.txt
|
|
copy-as {datadir/}file5R.txt {path2/} file5.txt
|
|
touch-glob 2001-03-04 {datadir/} file5L.txt
|
|
copy-as {datadir/}file5L.txt {path1/} file5.txt
|
|
|
|
test newer on path2 and deleted on path1 - file6
|
|
touch-copy 2001-01-02 {datadir/}file6.txt {path2/}
|
|
delete-file {path1/}file6.txt
|
|
|
|
test newer on path1 and deleted on path2 - file7
|
|
touch-copy 2001-01-02 {datadir/}file7.txt {path1/}
|
|
delete-file {path2/}file7.txt
|
|
|
|
test bisync run
|
|
bisync backupdir1={workdir/}backupdirs/backupdir1 backupdir2={workdir/}backupdirs/backupdir2
|
|
bisync backupdir1={workdir/}backupdirs/backupdir1 backupdir2={workdir/}backupdirs/backupdir2
|
|
|
|
test overlapping path -- should fail
|
|
bisync backupdir1={path1/}subdir/backupdir1 backupdir2={path2/}subdir/backupdir2
|