+ Post New Thread
Results 1 to 7 of 7
*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 ...
  1. #1
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29

    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?

    Code:
    # /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.
    
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    
    
    # 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
    
    #
    thanks

  2. #2
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    41
    Maybe try:

    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 02:42 PM.

  3. Thanks to apeo from:

    reggiep (30th October 2012)

  4. #3

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    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

    Steve

  5. Thanks to Steve21 from:

    reggiep (30th October 2012)

  6. #4
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    Quote Originally Posted by Steve21 View Post
    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

    Steve
    By Jove, you could be on to something there! I don't know how I missed that one!

    I'll give it another shot with root in there!

  7. #5

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by reggiep View Post
    By Jove, you could be on to something there! I don't know how I missed that one!

    I'll give it another shot with root in there!
    Any luck?

    Steve

  8. #6
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    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.

    thanks

  9. #7

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Good to hear One of those silly things. Logic says if it runs manually it should run scripted too!

    Steve

SHARE:
+ Post New Thread

Similar Threads

  1. [TASC] Can anyone tell me anything about Parrs texting service?
    By steele757 in forum MIS Systems
    Replies: 10
    Last Post: 21st October 2012, 07:25 PM
  2. Replies: 5
    Last Post: 29th February 2012, 03:30 PM
  3. Can Anyone Tell Us What This Is In Bedfordshire?
    By DaveP in forum General Chat
    Replies: 5
    Last Post: 26th July 2011, 10:14 AM
  4. New ISP - With Static IPs... Can anyone tell me subnet mask?
    By BackCat3 in forum Wireless Networks
    Replies: 11
    Last Post: 24th June 2011, 04:13 PM
  5. Can anyone tell me why... [Adobe]
    By indiegirl in forum General Chat
    Replies: 3
    Last Post: 27th June 2006, 05:46 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •