Skip to content

A simple shell script that is designed to use crontab(8) to push a repo.

Notifications You must be signed in to change notification settings

neil-smithline-shellscripts/auto-git-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Crontab-Friendly Git Update

A trivial shell script to facilitate pushing a Git repo via crontab(8). A line similar to

22 2 * * * $HOME/bin/auto-git-push $HOME/my-repo

in your crontab will cause the repo at $HOME/my-repo to be pushed every day at 2:22 AM.

The meat of the script executes these commands:

cd "$1"
git add -A .
git commit -q -m 'automated update'
git push -q

The -q flags will silence git unless an error occurs. This prevents crontab from sending email unless an actual error has occurred.

The script also tries to set a reasonable PATH. My guess is that this script will run on *NIX systems without modification. I’ll leave configuring it for Cygwin as an exercise to the reader :-)

About

A simple shell script that is designed to use crontab(8) to push a repo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages