Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new_files = [] #list of files newer than 1 day
- for f in os.listdir(path):
- fn = os.path.join(path,f)
- ctime = os.stat(fn).st_ctime
- if ctime > now - 1 * 86400:
- #this is a new file
- new_files.append(fn)
- if new_files(): #checks the list
- sendmail #calls sendmail script that sends email
- new_files = [] #list of files newer than 1 day
- for f in os.listdir(path):
- fn = os.path.join(path,f)
- ctime = os.stat(fn).st_ctime
- if ctime > now - 1 * 86400:
- countit=new_files.count(fn) #count previous occurence
- #this is a new file
- new_files.append(fn)
- if new_files.count(fn)>countit:
- sendmail #calls sendmail script that sends email
- Yes: if not seq:
- if seq:
- No: if len(seq)
- if not len(seq)
- if new_files:
Add Comment
Please, Sign In to add comment