Example #1
0
    def _make_backup(self):
        source_dir = os.path.join(TEST_DIR, 'test-dir')
        target_dir = os.path.join(TEST_DIR, 'backups')

        # Backup
        source = Source(source_dir, target_dir)
        source.backup()
Example #2
0
    def execute(self):
        source = Source(self.args['source_dir'], self.args['target_dir'])

        source_list = SourceList()

        if source in source_list:
            raise CommandError("such source already exists")

        source.backup()

        source_list.add(source)
        source_list.update()

        print("the source has been added successfully")