diff --git a/webnotes/utils/__init__.py b/webnotes/utils/__init__.py index 5d6b2ed6a7..e0a4ba71e9 100644 --- a/webnotes/utils/__init__.py +++ b/webnotes/utils/__init__.py @@ -910,5 +910,9 @@ def get_site_name(hostname): def get_disk_usage(): """get disk usage of files folder""" - err, out = execute_in_shell("du -hsm {files_path}".format(files_path=get_files_path())) - return cint(out.split("\n")[-2].split("\t")[0]) \ No newline at end of file + import os + files_path = get_files_path() + if not os.path.exists(files_path): + return 0 + err, out = execute_in_shell("du -hsm {files_path}".format(files_path=files_path)) + return cint(out.split("\n")[-2].split("\t")[0]) diff --git a/wnf.py b/wnf.py index f72758805d..1b24fd97f4 100755 --- a/wnf.py +++ b/wnf.py @@ -348,6 +348,7 @@ def backup(site=None, with_files=False, verbose=True, backup_path_db=None, backu print "database backup taken -", odb.backup_path_db, "- on", now() if with_files: print "files backup taken -", odb.backup_path_files, "- on", now() + webnotes.destroy() return odb @cmd