LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-05-2005, 03:24 AM   #1
Arndt
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Rep: Reputation: 0
Problem with cronjob


Hello,

if I execute a shell-script over the command shell with ./backup.sh it works fine. If I create a cronjob with contab -e

0 23 * * 0,1,2,3,4,5 /backup.sh

then the shell script doesn't work.
The shell script begins to start at 11pm and
hang up.
Where is the problem?

In the shell script I use abolute paths.

Can you help me?

Arndt

Last edited by Arndt; 04-05-2005 at 03:26 AM.
 
Old 04-05-2005, 05:40 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

This command: ./backup.sh tells me that the backup.sh script is not to be found in the PATH variable. Cron (which one are you actually using?) has an even more limited PATH (if any).

0 23 * * 0,1,2,3,4,5 /backup.sh

Should be:

0 23 * * 0,1,2,3,4,5 cd /path/to/program ; ./backup.sh

or

0 23 * * 0,1,2,3,4,5 /full/path/to/backup.sh

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
cronjob problem chadi Linux - General 5 10-10-2004 09:09 PM
cronjob problem ashley75 Linux - General 2 05-28-2004 05:47 PM
cronjob help meeh Linux - General 1 03-26-2004 11:41 AM
Su in a cronjob michedlp Programming 3 11-06-2003 08:30 AM
cronjob FastEddy Linux - General 1 04-12-2003 09:52 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration