Find the answer to your Linux question:
Results 1 to 2 of 2
I'm a complete Linux newbie, so please be gentle with me. I'm doing some unpaid, voluntary work with a local charity, and they've asked me to look at a problematic ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    1

    cron not running scheduled job

    I'm a complete Linux newbie, so please be gentle with me.

    I'm doing some unpaid, voluntary work with a local charity, and they've asked me to look at a problematic SuSe Linux Enterprise Server 10 directory backup.

    Someone in the past was supposed to have set up a job that would copy (/bin/cp -R -u) a set of directories and their contents from the Linux server to a folder on a Windows XP PC. The PC's user would then copy the folders on to a removable USB drive for off-site storage. The script works if run manually. cron.allow doesn't exist and cron.deny has only two entries - guest and gast.

    When I first started looking into it last week, I couldn't find any evidence of a cron job. So far as I can tell, only there are only two users allowed to log on directly to the server - root and administrator. I ran a crontab -u root -l and a crontab -u administrator -l, but neither command showed a cron job set up to run the backup script. There are several other users who seem to have remote access to the server only. These will be the charity's employees who need to store their Word documents, Excel spreadsheets, etc on the server. I ran a crontab -l for each one of the other user accounts - just in case - and none of them had any cron jobs set up.

    I used YaST to check that the cron daemon is running. It is. I used crontab -u administrator -e to add the script to the administrator's crontab. The relevant entry reads:

    0 20 * * * /home/administrator/backup/backup.pl > /home/administrator/backup/backup.log

    When I checked the following morning, there was no evidence that the job had run at 20:00 the previous day. I amended the crontab file to use a time within the next 5 to 10 minutes so that I could see what happened, but when the time came, nothing did.

    So, even though the cron daemon is running, and the crontab entry appears to be valid, the job doesn't run. I suspect that I'm missing something, but I don't know what. Any help or guidance would be appreciated.

    Incidentally, I was logged on to the server as root, but surely the cron job would still run even though it's configured for the administrator user account?

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Two different issues - 1) where is the old cron and 2) setting up your new cron job.

    1) Look under the /etc/cron.* directories to see if the old job is under one of those folders.

    2) Review the /var/log/messages file for cron activites:

    Code:
    grep cron /var/log/messages

Posting Permissions

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