diff --git a/bin/zfs-autobackup b/bin/zfs-autobackup index 4435af2..da98652 100755 --- a/bin/zfs-autobackup +++ b/bin/zfs-autobackup @@ -1554,8 +1554,8 @@ class ZfsAutobackup: parser.add_argument('--keep-source', type=str, default="10,1d1w,1w1m,1m1y", help='Thinning schedule for old source snapshots. Default: %(default)s') parser.add_argument('--keep-target', type=str, default="10,1d1w,1w1m,1m1y", help='Thinning schedule for old target snapshots. Default: %(default)s') - parser.add_argument('backup_name', help='Name of the backup (you should set the zfs property "autobackup:backup-name" to true on filesystems you want to backup') - parser.add_argument('target_path', default=None, nargs='?', help='Target ZFS filesystem (optional: if not specified, zfs-autobackup will only operate as snapshot-tool on source)') + parser.add_argument('backup_name', metavar='backup-name', help='Name of the backup (you should set the zfs property "autobackup:backup-name" to true on filesystems you want to backup') + parser.add_argument('target_path', metavar='target-path', default=None, nargs='?', help='Target ZFS filesystem (optional: if not specified, zfs-autobackup will only operate as snapshot-tool on source)') parser.add_argument('--other-snapshots', action='store_true', help='Send over other snapshots as well, not just the ones created by this tool.') parser.add_argument('--no-snapshot', action='store_true', help='Don\'t create new snapshots (useful for finishing uncompleted backups, or cleanups)') @@ -1727,12 +1727,12 @@ class ZfsAutobackup: description="[Source]" source_thinner=Thinner(self.args.keep_source) source_node=ZfsNode(self.args.backup_name, self, ssh_config=self.args.ssh_config, ssh_to=self.args.ssh_source, readonly=self.args.test, debug_output=self.args.debug_output, description=description, thinner=source_thinner) - source_node.verbose("Send all datasets that have 'autobackup:{}=true' or 'autobackup:{}=child'".format(self.args.backup_name, self.args.backup_name)) + source_node.verbose("Selects all datasets that have property 'autobackup:{}=true' (or childs of datasets that have 'autobackup:{}=child')".format(self.args.backup_name, self.args.backup_name)) self.set_title("Selecting") selected_source_datasets=source_node.selected_datasets if not selected_source_datasets: - self.error("No source filesystems selected, please do a 'zfs set autobackup:{0}=true' on the source datasets you want to backup.".format(self.args.backup_name)) + self.error("No source filesystems selected, please do a 'zfs set autobackup:{0}=true' on the source datasets you want to select.".format(self.args.backup_name)) return(255) source_datasets=[] diff --git a/test_regressions.py b/test_regressions.py new file mode 100644 index 0000000..d33ce09 --- /dev/null +++ b/test_regressions.py @@ -0,0 +1,20 @@ + +from basetest import * + + +class TestZfsNode(unittest2.TestCase): + + def setUp(self): + prepare_zpools() + self.longMessage=True + + # #resume initial backup + # def test_keepsource0(self): + + # #somehow only specifying --allow-empty --keep-source 0 failed: + # with patch('time.strftime', return_value="20101111000000"): + # self.assertFalse(ZfsAutobackup("test test_target1 --verbose --allow-empty --keep-source 0".split(" ")).run()) + + # with patch('time.strftime', return_value="20101111000001"): + # self.assertFalse(ZfsAutobackup("test test_target1 --verbose --allow-empty --keep-source 0".split(" ")).run()) +