summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHui Lan <lanhui@zjnu.edu.cn>2020-02-06 17:46:48 +0800
committerHui Lan <lanhui@zjnu.edu.cn>2020-02-06 17:46:48 +0800
commit5eef69227ab44849ea46f74a735c2dfecb7dda89 (patch)
treedc824becc3f9e8674c6d23c1d9db8c89f771be07
parent97db795240795d947241ff30a8beafbd3aca93b8 (diff)
backup_files.py: remove the cd command - we do not need to cd to a directory to gzip a file inside it.
-rw-r--r--Code/backup_files.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Code/backup_files.py b/Code/backup_files.py
index c7ee4f4..6105525 100644
--- a/Code/backup_files.py
+++ b/Code/backup_files.py
@@ -44,7 +44,7 @@ def copy_and_backup_file(src_file, dest_dir):
make_paths(dest_dir) # if dest_dir does not exist, create it.
curr_date = datetime.now().strftime('%Y%m%d')
dest_file = os.path.join(dest_dir, os.path.basename(src_file) + '.' + curr_date)
- cmd = 'cp %s %s && cd %s && gzip -f %s' % (src_file, dest_file, dest_dir, dest_file)
+ cmd = 'cp %s %s && gzip -f %s' % (src_file, dest_file, dest_file)
os.system(cmd)
write_log_file('[backup_files.py] File %s has been backed up to %s and zipped (.gz)' % (src_file, dest_file), UPDATE_NETWORK_LOG_FILE)