*nix Thread, Can anyone tell me why this crontab isn't running my backups? in Technical; The last line in my crontab is set to run a script to backup my hardware database but fails to ...
30th October 2012, 03:29 PM #1
Can anyone tell me why this crontab isn't running my backups?
The last line in my crontab is set to run a script to backup my hardware database but fails to run. If I run the script manually all works as you would expect.
Is this the correct way to do this or is there a alternative?
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
*/5 * * * * root php /var/www/mahara/cacti/poller.php > /dev/null 2>&1
* * * * * curl http://localhost/lib/cron.php
00 12 * * Mon-Sun root /etc/cron.daily/ntpdate
20 14 * * mon-sun /usr/local/maharabackup/glpibackup.sh > /var/log/rootglpibackup.log 2>&1
30th October 2012, 03:38 PM #2
20 14 * * * sh /usr/local/maharabackup/glpibackup.sh > /var/log/rootglpibackup.log 2>&1
Replaced mon-sun to * because its everyday, thats * isnt it?
Last edited by apeo; 30th October 2012 at 03:42 PM.
Thanks to apeo from:
reggiep (30th October 2012)
30th October 2012, 03:41 PM #3
Do you not need a user to run it as? If you're running it manually I guess it may pick you, but run on timer I thought it had to have one? But may be totally wrong
Thanks to Steve21 from:
reggiep (30th October 2012)
30th October 2012, 03:49 PM #4
By Jove, you could be on to something there! I don't know how I missed that one!
Originally Posted by Steve21
I'll give it another shot with root in there!
30th October 2012, 04:26 PM #5
Originally Posted by reggiep
31st October 2012, 01:46 PM #6
Yep all working now. I tidied it up a bit as well so I could see that all the lines had all the right info needed.
31st October 2012, 01:57 PM #7
Good to hear One of those silly things. Logic says if it runs manually it should run scripted too!
By steele757 in forum MIS Systems
Last Post: 21st October 2012, 08:25 PM
By Davit2005 in forum Home Access Plus+
Last Post: 29th February 2012, 04:30 PM
By DaveP in forum General Chat
Last Post: 26th July 2011, 11:14 AM
By BackCat3 in forum Wireless Networks
Last Post: 24th June 2011, 05:13 PM
By indiegirl in forum General Chat
Last Post: 27th June 2006, 06:46 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)