Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have created a cron job using gnome-schedule in fedora 13 server to get backups of the mysql database. but the thing is the sh file runs when execute ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie amithad's Avatar
    Join Date
    Sep 2006
    Location
    Sri Lanka
    Posts
    160

    Question Cron job doesn't work


    Hi,

    I have created a cron job using gnome-schedule in fedora 13 server to get backups of the mysql database.
    but the thing is the sh file runs when execute it manually; but when it is run through the gnome-schedule program or editing the crontab file using 'crontab -e' command it doesn't ??????

    the same thing I did for another fedora 13 server some time ago and it runs perfectly

    I did every thing that I can ( allowing cron related options in SE Linux etc)

    the sh file resides in the home folder /home/user1/backup.sh and is given chmod +x permission

    help is greatly appreciated

    Thanks

    Amitha

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Show the contents of this command, so we can see exactly what cron is trying to run:
    Code:
    crontab -l
    Also, check out cron's log, typically:

    /var/log/cron

    It is usually very helpful to redirect the output of your cronjob to a temporary log file, e.g.:

    Code:
    * * * * * /home/user/script.sh > /tmp/script.log 2>&1

  3. #3
    Linux Newbie amithad's Avatar
    Join Date
    Sep 2006
    Location
    Sri Lanka
    Posts
    160
    Dear atreyu,

    Thanks so much for your reply. when I execute crontab -l command I got the following results

    0 15 * * * /home/user1/backup.sh # JOB_ID_1
    then I logged as root and execute the cron job in root GUI, to my elation it worked once. but when I change the time and reschedule the cronjob it didn't work
    finally I tried Webmin it is working fine with Webmin. the latest crontab -l output which work in the normal user account(in webmin) as follows

    5,22 14 * * * /home/user1/backup.sh #BackupJob
    Thanks

    Amitha
    Last edited by amithad; 08-25-2011 at 04:25 AM.

Posting Permissions

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