I look into a lot of answers about this subject, but something is wrong here, let me explain.
I create this script, to make my cron
cleaner :)
#!/bin/bash
cd /home/valter.silva/Development/git/valter/
/usr/bin/git add -A
/usr/bin/git commit -am "update `date`"
/usr/bin/git push
Then add it at my cron, valter.silva's cron
, not my root cron
:
00 * * * * /home/valter.silva/Development/git/valter/scripts/git/sync.sh
Restart my cron
sudo service cron restart
cron stop/waiting
cron start/running, process 6047
Aaand .. nothing happens..
But if I execute my script in command line, everything works fine. I know for a fact that sometimes if you don't put the whole path at cron scripts won't work correctly. And that I should use my cron to do that, not root's cron.
So what's wrong here ? Any ideas ? Thank you!
udpate
I follow Terdon suggestion, into log the operation, but it seems everything is okay, but not the push
process though. Why ?
[master ad5d001] update Fri Aug 9 11:00:01 BRT 2013
9 files changed, 1224 insertions(+), 364 deletions(-)
create mode 100644 scripts/centreon/4.answers~
create mode 100644 scripts/centreon/6.importing database
create mode 100644 scripts/centreon/6.importing database~
create mode 100755 scripts/centreon/7.upgrade.sh
create mode 100755 scripts/centreon/7.upgrade.sh~
create mode 100644 scripts/centreon/8.answers
create mode 100644 scripts/centreon/8.answers~
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
crontab -e
)? What doescrontab -l
report? You can try to addSHELL=/bin/bash
andMAILTO="valter.silva"
into your user's crontab. Especially the latter might give you some error messages in your local mail (/var/spool/mail/valter.silva
) if local mail system is working. And IMHO there is no need to restart thecron
service.crontab -e
, notsudo crontab -e
. Thecrontab -l
is exactly that entry that I post it, there's only this entry in my cron.