def _create_archive(number_of_turns): while number_of_turns > 0: backup_thread = restic.BackupThread(['.']) backup_thread.run() number_of_turns -= 1 list_thread = restic.ListThread() return list_thread.run()
def background_backup(self): self.config.read() self.config._set_environment_variables() backup_thread = restic.BackupThread(self.config.includes, excludes=self.config.excludes, prefix=self.config.prefix) backup_thread.run() if self.config.retention_policy_enabled: prune_thread = restic.PruneThread(self.config.retention_policy) prune_thread.run()
def create_backup(self): """Creates a backup of the selected item in the treeview.""" if not self._check_mounts(): return try: self._check_path() backup_thread = restic.BackupThread([self.src_path], excludes=self.config.excludes, prefix=self.config.prefix) backup_dialog = ProgressDialog(backup_thread) backup_dialog.label_info.setText("Restic-Qt is currently creating an" " archive.") backup_dialog.exec_() if self.config.retention_policy_enabled: prune_thread = restic.PruneThread(self.config.retention_policy) prune_dialog = ProgressDialog(prune_thread) prune_dialog.label_info.setText("Restic-Qt is currently pruning " "the repository.") prune_dialog.exec_() self.update_ui() except ResticException as e: show_error(e)
def test_info(repository): backup_thread = restic.BackupThread(['.']) backup_thread.run() info_thread = restic.InfoThread() output = info_thread.run() assert len(output) == 2
def test_list(repository): backup_thread = restic.BackupThread(['.']) backup_thread.run() list_thread = restic.ListThread() output = list_thread.run() assert str(os.path.realpath('.')) == output[0]['paths'][0]
def test_backup(repository): backup_thread = restic.BackupThread(['.']) backup_thread.run() output = subprocess.check_output(['restic', 'snapshots', '--json'], encoding='utf8') assert -1 != output.find(str(os.path.realpath('.')))
def archives(repository): backup_thread = restic.BackupThread(['.']) backup_thread.run() list_thread = restic.ListThread() output = list_thread.run() return output