diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2024-08-07 11:54:45 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2024-08-07 11:54:45 +0800 |
commit | e48a12c582bd8df222a74747c32c5a691b7e7782 (patch) | |
tree | e264354790126c9980e11c12f85c45475d9fde6f /Code/backup_files.py | |
parent | 4b64732ce6acdf75cf5b8469e42f15e625fee8b0 (diff) |
Put the definition of make_paths() in utils.py because multiple places use it
Diffstat (limited to 'Code/backup_files.py')
-rw-r--r-- | Code/backup_files.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Code/backup_files.py b/Code/backup_files.py index 0b044f1..1ab3fab 100644 --- a/Code/backup_files.py +++ b/Code/backup_files.py @@ -10,14 +10,10 @@ import os, sys from configure import UPDATE_NETWORK_LOG_FILE from datetime import datetime from log import write_log_file +from utils import make_paths MINIMUM_SPACE_REQUIREMENT = 1 # Gigabytes -def make_paths(s): - if not os.path.isdir(s): - os.makedirs(s) - - def disk_has_enough_space(): available_G = 4 * os.statvfs('/home').f_bavail / (1024*1024) # compute available space (in Gigabytes). Each block has 4k bytes, work for Linux/UNIX systems only if available_G < MINIMUM_SPACE_REQUIREMENT: |