**********incrontab -e**************** /home/nycnight.com/telecomm/7185695555.WAV/ IN_CLOSE_WRITE /home/prog-shit/sendmail-script.py $# /home/nycnight.com/telecomm/5166885555.WAV/ IN_CLOSE_WRITE /home/prog-shit/sendmail-script.py $# /var/spool/asterisk/monitor/ IN_CLOSE_WRITE /home/prog-shit/watch-script2.py $# *****************script 1************* #!/usr/bin/env python import os path1 = "/var/spool/asterisk/monitor/" path2 = "/home/nycnightgirls.com/telecomm/" files = os.listdir(path1) for file in files: if file.lower().endswith(".wav"): phone_number = file[-14:] output_dir = os.path.join(path2, phone_number) if not os.path.exists(output_dir): os.mkdir(output_dir) os.rename(os.path.join(path1, file), os.path.join(output_dir, file)) ****************script2**************** #!/usr/bin/python import smtplib fromaddr = 'bcddddddd@yahoo.com' toaddrs = 'nycbbbbbb@gmail.com' subject = "New call in!" msg = 'New call in!!!' username = 'bcddddddd@gmail.com' password = 'abghujk' server = smtplib.SMTP('smtp.gmail.com:587') server.starttls() server.login(username,password) server.sendmail(fromaddr, toaddrs,subject, msg) server.quit()