Created
July 15, 2016 05:28
-
-
Save strangeman/d0f54298f476a6b23fdc935f59f2fbf4 to your computer and use it in GitHub Desktop.
Delete many files from nginx cache
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
from time import sleep | |
import os | |
path = '/var/cache/nginx/client_temp/' | |
for file_name in xrange(0, 9999999999): | |
file_path = '/var/cache/nginx/client_temp/'+str(file_name).zfill(10) | |
print 'trying to delete '+file_path | |
try: | |
os.remove(file_path) | |
print 'deleted '+file_path | |
sleep(0.05) | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment