From 5383b3cc89caa0a6668706534c8bdc31fd930a67 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 7 Nov 2013 13:12:36 +0530 Subject: [PATCH] [minor] [fix] backup --- webnotes/utils/backups.py | 5 +---- wnf.py | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/webnotes/utils/backups.py b/webnotes/utils/backups.py index bb43d9468d..469b307767 100644 --- a/webnotes/utils/backups.py +++ b/webnotes/utils/backups.py @@ -44,7 +44,7 @@ class BackupGenerator: last_db, last_file = self.get_recent_backup(older_than) if not (self.backup_path_files and self.backup_path_db): self.set_backup_file_name() - if not last_db and not last_file: + if not (last_db and last_file): self.take_dump() if not ignore_files: self.zip_files() @@ -148,9 +148,6 @@ def scheduled_backup(older_than=6, ignore_files=False, backup_path_db=None, back deletes backups older than 7 days takes backup""" odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files) - - from webnotes.utils import now - print "backup taken -", odb.backup_path_db, "- on", now() return odb def new_backup(older_than=6, ignore_files=False, backup_path_db=None, backup_path_files=None): diff --git a/wnf.py b/wnf.py index 91dc89fc3f..8a594788d3 100755 --- a/wnf.py +++ b/wnf.py @@ -331,11 +331,12 @@ def watch(): def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backup_path_files=None): from webnotes.utils.backups import scheduled_backup webnotes.connect(site=site) - print backup_path_db odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files) if verbose: from webnotes.utils import now - print "backup taken -", odb.backup_path_db, "- on", now() + print "database backup taken -", odb.backup_path_db, "- on", now() + if with_files: + print "files backup taken -", odb.backup_path_files, "- on", now() return odb @cmd