Reputation: 58781
I'm running a cronjob that pulls a Git repository and pushes it to another location. I would like to have the cronjob run silently, but whenever something fails I would like to be notified by mail. Conveniently, cron's default setting is to send out a mail whenever the stderr buffer is not empty.
The output of git pull > /dev/null
is indeed void if the local branch is up-to-date, but git push > /dev/null
isn't:
$ git push > /dev/null
Everything up-to-date
This results in a mail by cron on every git push
. I do not want to neglect stderr like
$ git push > /dev/null 2>&1
since I'd like to be notified of actual failures.
Any ideas?
Upvotes: 1
Views: 202