Created
August 31, 2018 01:47
-
-
Save shinshiner/e1bcd988c86f512dd52fab3bd6cecc9c to your computer and use it in GitHub Desktop.
A small script to clean your disk, preventing data recovery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
total = 80 # the number of copied files, decided by your free disk space | |
times = 2 # clean times, the more, the better | |
big_file = 'xxx' # a big file, maybe a .zip file or others ... | |
for j in range(times): | |
for i in range(total): | |
tgt_path = '%03d' % i | |
print(tgt_path) | |
if not os.path.exists(tgt_path): | |
os.makedirs(tgt_path) | |
os.system('cp %s ~/%03d/' % (big_file, i)) | |
time.sleep(60) | |
for i in range(total): | |
os.system('rm -r ~/%03d' % i) | |
print('finish clean disk\n') | |
time.sleep(120) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment