Skip to content

Instantly share code, notes, and snippets.

@jay16
Created December 15, 2013 08:59
Show Gist options
  • Save jay16/7970577 to your computer and use it in GitHub Desktop.
Save jay16/7970577 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
timestamp = Time.now.strftime("%Y/%m/%d-%H:%M:%S")
shell_content =<<SHELL
git_path=$(which git)
cd /home/work/solife
${git_path} init
${git_path} add -A .
${git_path} commit -a -m "auto commit - #{timestamp}"
${git_path} push origin master -f
SHELL
system(shell_content)
#crontab
#15 * * * * /home/work/solife/script/crond/git_push.rb > /home/work/solife/script/log/git_push.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment