diff options
| author | Britney Fransen <brfransen@gmail.com> | 2025-11-12 04:19:43 (GMT) |
|---|---|---|
| committer | Britney Fransen <brfransen@gmail.com> | 2025-11-12 04:19:43 (GMT) |
| commit | e875d03567c7e2cacf201f855b28fc94d08dcdb3 (patch) | |
| tree | 4473eb93d66499173548fee1e9a880c615dca48c /linhes/linhes-system/empty_storage_groups.py | |
| parent | e8759985ae97729b9ac4b11af1acf8bf94e87559 (diff) | |
| download | linhes_pkgbuild-e875d03567c7e2cacf201f855b28fc94d08dcdb3.zip linhes_pkgbuild-e875d03567c7e2cacf201f855b28fc94d08dcdb3.tar.gz linhes_pkgbuild-e875d03567c7e2cacf201f855b28fc94d08dcdb3.tar.bz2 | |
linhes-system: add_storage.py: add filesystem option and fix some partitions being detected as a disk
empty_storage_groups.py: add loop to wait and resume moving files
Diffstat (limited to 'linhes/linhes-system/empty_storage_groups.py')
| -rwxr-xr-x | linhes/linhes-system/empty_storage_groups.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/linhes/linhes-system/empty_storage_groups.py b/linhes/linhes-system/empty_storage_groups.py index c181242..1fc4208 100755 --- a/linhes/linhes-system/empty_storage_groups.py +++ b/linhes/linhes-system/empty_storage_groups.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import argparse, glob, operator, os, random, shutil, subprocess, sys, signal +import argparse, glob, operator, os, random, shutil, subprocess, sys, signal, time shouldQuit = False def getFreeSpaceForDir(dir): @@ -163,11 +163,18 @@ if __name__ == '__main__': print("Check Only option was used. No files were moved.") shouldQuit = True else: - print("------------------------------------------------") - print("Checking System Status...") - if subprocess.call(["/usr/bin/python", "/usr/bin/idle.py", "-s"]): - print(" System is busy. The file will not be moved.") - sys.exit() + isBusy = True + while isBusy: + if shouldQuit: + sys.exit(0) + print("------------------------------------------------") + print("Checking System Status...") + if subprocess.call(["/usr/bin/python", "/usr/bin/idle.py", "-s"]): + print(" System is busy. The file will not be moved.") + print(" Waiting 5 minutes before trying again.") + time.sleep(300) + else: + isBusy = False print("Moving File...") try: shutil.move(filePathToMove, leastFull[0]) |
