Skip to content

Instantly share code, notes, and snippets.

@raed667
Last active October 1, 2016 10:44
Show Gist options
  • Save raed667/cd02b671c5a63a528ee3b004fd0263f2 to your computer and use it in GitHub Desktop.
Save raed667/cd02b671c5a63a528ee3b004fd0263f2 to your computer and use it in GitHub Desktop.
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')
@raed667
Copy link
Author

raed667 commented Oct 1, 2016

Why is this in Python instead of bash .... no idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment