LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cron error: no job control (https://www.linuxquestions.org/questions/linux-software-2/cron-error-no-job-control-343571/)

schentor 07-15-2005 04:50 PM

cron error: no job control
 
Hi,

I set up a Perl script to be run as a nightly cron job at 3:23 AM with the line
Code:

23 03 * * * * cd /backup1/backup_adm/; perl backup.pl
in my crontab file. The script creates a tar file in an NFS-mounted directory. Every night I receive an email saying:
Code:

/bin/sh: fg: no job control
Can't open perl script "backup.pl": No such file or directory

but I can successfully run the same series of commands manually, and backup.pl is definitely in /backup1/backup_adm. A monthly cron job belonging to the same user that FTPs data to a remote site also returns the same "no job control" error, but without the "no such file or directory" error.

How do I make these cron jobs run?

Thanks,
S. Chen

crabboy 07-15-2005 10:31 PM

I'd try creating a shell script to run your commands:
Code:

#!/bin/bash

cd cd /backup1/backup_adm
/usr/bin/perl ./backup.pl

Code:

23 03 * * * * /backup1/backup_adm/myScript.sh > /backup1/backup_adm/logs/backup.log

schentor 07-18-2005 12:39 PM

I wrote a shell script calling the Perl script and put it in my crontab file, and it worked. Thanks!


All times are GMT -5. The time now is 09:24 PM.