Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import datetime
  2. import os
  3.  
  4. #crontab -e
  5. #0 12 * * * /usr/bin/python /path/to/file.py > /path/to/log.txt
  6.  
  7. with open('/path/to/file.txt', 'a') as file:
  8. file.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+"\n")
  9.  
  10. print "run ssh"
  11. os.system('cd /path/to/ ; eval `ssh-agent -s`; ssh-add /home/USER/.ssh/github ; git add -A; git commit -m "'+datetime.datetime.now().strftime("%Y-%m-%d %
  12. H:%M:%S")+'" ; git push -u origin master')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement