Find the answer to your Linux question:
Results 1 to 2 of 2
Guys, please help me fix this problem. Its kind of urgent..I sat on it for more than 2 days. But im totally lost. Its a pretty dumb problem actually. Im ...
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    10

    Cronjob problem

    Guys,

    please help me fix this problem. Its kind of urgent..I sat on it for more than 2 days. But im totally lost. Its a pretty dumb problem actually.

    Im trying to run a crontask on a remote system. I should execute a shell script at a given time.

    For ex: * * * * * bash /Users/name/sample.sh

    In the script ive included commands to perform database backup. It works fine. But the problem is that, ive to run a perl script prior to the execute of mysqldump. For some dumb reason, it wouldnt execute.
    Details of the file sample.sh:

    /usr/bin/perl /Users/name/chumma.pl

    If i run this command it should update some tables in my local database. Then i should run mysqldump to import it to a remote database, which works fine.

    I dont know why the crontask wouldnt execute. I dont know if there is a problem with the shell syntax or the perl syntax.

    Please not that, i SSH into a remote system to run the cronjob..

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    You might need to use a fully qualified path to bash - /bin/bash.

    If that's not enough, check the mailbox of the user running the cronjob to see if there are any hints in there as to why it's failing. It might help to see the perl script - does it rely on its environment in any way which isn't applicable when the script runs under cron?

    Not sure I understand your comment that you ssh into a remote system to run the cronjob, surely the local cron runs the job?

Posting Permissions

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