mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-11 22:40:01 +03:00
fix
This commit is contained in:
parent
44c6896ddd
commit
d99c202e75
@ -79,3 +79,19 @@ test_target1/b/test_target1/a/test_source1/fs1/sub@test-20101111000000
|
||||
self.assertFalse(
|
||||
ZfsAutobackup("test test_target1 --no-progress --verbose --debug --zfs-compressed".split(" ")).run())
|
||||
|
||||
def test_force(self):
|
||||
"""test 1:1 replication"""
|
||||
|
||||
shelltest("zfs set autobackup:test=true test_source1")
|
||||
|
||||
with patch('time.strftime', return_value="test-20101111000000"):
|
||||
self.assertFalse(
|
||||
ZfsAutobackup("test test_target1 --no-progress --verbose --debug --force --strip-path=1".split(" ")).run())
|
||||
|
||||
r=shelltest("zfs list -H -o name -r -t snapshot test_target1")
|
||||
self.assertMultiLineEqual(r,"""
|
||||
test_target1@test-20101111000000
|
||||
test_target1/fs1@test-20101111000000
|
||||
test_target1/fs1/sub@test-20101111000000
|
||||
test_target1/fs2/sub@test-20101111000000
|
||||
""")
|
||||
|
@ -91,6 +91,8 @@ class ZfsAutobackup(ZfsAuto):
|
||||
group.add_argument('--rollback', action='store_true',
|
||||
help='Rollback changes to the latest target snapshot before starting. (normally you can '
|
||||
'prevent changes by setting the readonly property on the target_path to on)')
|
||||
group.add_argument('--force', '-F', action='store_true',
|
||||
help='Use zfs -F option to force overwrite/rollback. (Usefull with --strip-path=1, but use with care)')
|
||||
group.add_argument('--destroy-incompatible', action='store_true',
|
||||
help='Destroy incompatible snapshots on target. Use with care! (implies --rollback)')
|
||||
group.add_argument('--ignore-transfer-errors', action='store_true',
|
||||
|
Loading…
x
Reference in New Issue
Block a user