diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2024-08-05 14:44:44 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2024-08-05 14:44:44 +0800 |
commit | df4af8751a5c1e1465159083100b82e58e7778f7 (patch) | |
tree | 4962f84f789520f3e3be54e94ff11f06d5e35e8f /Code/backup_files.py | |
parent | 0d5e23b870ef9fa21cc90e31150dc1c27d56b3f8 (diff) |
Update write_log_file() so that it put the most recent message on the top; remove duplicate write_log_file()
Diffstat (limited to 'Code/backup_files.py')
-rw-r--r-- | Code/backup_files.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Code/backup_files.py b/Code/backup_files.py index 6105525..0b044f1 100644 --- a/Code/backup_files.py +++ b/Code/backup_files.py @@ -9,21 +9,10 @@ import os, sys from configure import UPDATE_NETWORK_LOG_FILE from datetime import datetime +from log import write_log_file MINIMUM_SPACE_REQUIREMENT = 1 # Gigabytes -def write_log_file(s, fname): - if not os.path.exists(fname): - return None - f = open(fname, 'a') - curr_time = datetime.now().strftime('%Y-%m-%d %H:%M') - s = '[' + curr_time + ']: ' + s - if not '\n' in s: - s += '\n' - f.write(s) - f.close() - - def make_paths(s): if not os.path.isdir(s): os.makedirs(s) |