Skip to content

Instantly share code, notes, and snippets.

@kanghyojun
Created January 21, 2014 07:38
Show Gist options
  • Select an option

  • Save kanghyojun/8535803 to your computer and use it in GitHub Desktop.

Select an option

Save kanghyojun/8535803 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from os import walk, path
from sys import argv
from subprocess import call
from threading import Timer
from time import ctime
path_ = u'/home/hyojun/src/a'
def remove_file():
global path_
print 'removing files at %s' % ctime()
for r, _, p in walk(path_):
for p_ in p:
call(['rm', path.join(r, p_)])
Timer(5, remove_file).start()
if __name__ == '__main__':
remove_file()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment