Last active
October 1, 2016 10:44
-
-
Save raed667/cd02b671c5a63a528ee3b004fd0263f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why is this in Python instead of bash .... no idea