LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-15-2005, 04:50 PM   #1
schentor
Member
 
Registered: Jul 2005
Distribution: RHEL, Mint, Ubuntu
Posts: 32

Rep: Reputation: 15
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
 
Old 07-15-2005, 10:31 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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
 
Old 07-18-2005, 12:39 PM   #3
schentor
Member
 
Registered: Jul 2005
Distribution: RHEL, Mint, Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
I wrote a shell script calling the Perl script and put it in my crontab file, and it worked. Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron job wbatzle Linux - Newbie 2 07-12-2005 04:19 PM
"permission denied" error when cron job executes jillu Linux - Newbie 11 11-02-2004 01:19 PM
cron job the_rhino Linux - Newbie 10 10-02-2004 03:34 PM
cron job <defunct> error? existo Slackware 7 01-21-2004 03:39 PM
cron job ? johnyy Linux - Software 3 12-10-2003 06:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration