Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- import os
- #crontab -e
- #0 12 * * * /usr/bin/python /path/to/file.py > /path/to/log.txt
- with open('/path/to/file.txt', 'a') as file:
- file.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+"\n")
- print "run ssh"
- 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 %
- H:%M:%S")+'" ; git push -u origin master')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement