Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-02-2012, 12:46 PM   #1
Registered: Feb 2010
Posts: 31

Rep: Reputation: 0
Unhappy having trouble getting a crontab to work

I set up a crontab to run a csh script that performs backups everyday at 2am and it works great.

I am trying to add a second crontab that will run a csh script every minute to see if a file exists in a queue directory. If true the csh script sources the file in the queue to set some variables. then it sources some more csh scripts to run a cad program and process various parts for manufacture. My expectation is that every minute I should see the cad software start processing a job. I dont see this happening.

This is the crontab tasks
1 2 * * * /genesis/sys/scripts/FTG_mkk/auto_backup_from_cron
* * * * * /genesis/sys/scripts/FTG_mkk1/qreader
There are no blank lines at the end. I was concerned about path definition but the first line is executing fine, creating log file entries etc. and the paths are same in script executed by next line. I could add the info from $path for the user and software run to the cron $path but not sure how to do this.

I also tried */1 * * * * instead of * * * * *

I checked the cron log in /var/log and see it executing every minute but I dont see anything happening.

Aug 2 10:31:01 genesis7 crond[9680]: (genesis) CMD (/genesis/sys/scripts/FTG_mkk1/qreader)
Aug 2 10:32:01 genesis7 crond[9692]: (genesis) CMD (/genesis/sys/scripts/FTG_mkk1/qreader)
Aug 2 10:33:01 genesis7 crond[9695]: (genesis) CMD (/genesis/sys/scripts/FTG_mkk1/qreader)
Aug 2 10:34:01 genesis7 crond[9700]: (genesis) CMD (/genesis/sys/scripts/FTG_mkk1/qreader)

The csh script the cron is executing for test purposes contains the 4 lines below.

echo cron executed
echo cron executed > /tmp/mkkct

I dont see anything happening. The mkkct file isn't appearing in /tmp
Allm I see are log entries every minute.

Help please
Old 08-02-2012, 12:53 PM   #2
Registered: Feb 2010
Posts: 31

Original Poster
Rep: Reputation: 0
I forgot to mention I'm using Red Hat 5.0

Also any info on scheduling software for linux that would be more appropriate would be appreciated.
Old 08-02-2012, 12:54 PM   #3
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
Just to make are calling:

* * * * * /genesis/sys/scripts/FTG_mkk1/qreader

The script that works is in /genesis/sys/scripts/FTG_mkk, but this one is in /genesis/sys/scripts/FTG_mkk1

is that correct?

If so, what are the permissions/ownership of /genesis/sys/scripts/FTG_mkk1/qreader? What user is the cron running under?

Also to confirm, the */1 is how you have it run every minute.
Old 08-02-2012, 01:33 PM   #4
Registered: Feb 2010
Posts: 31

Original Poster
Rep: Reputation: 0
The cron was created as one of the users that would normally perform these tasks and all the permissions are set to allow the groups this user belongs to execute privilege. I can run the script logged in as this user fine. Just wont run as crontab. All the files involved are owned by this user and are executable + the group is correctly set as well.

The crontab entry looks like this and the qreader script is in FTGmkk1.
* * * * * /genesis/sys/scripts/FTG_mkk1/qreader

I am using * instead of */1 and the log shows it executing every minute.


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
[SOLVED] one script does not work at crontab windstory Linux - Newbie 7 08-13-2010 02:56 AM
Crontab does not work riotxix Linux - Software 15 12-14-2006 01:30 AM
work with crontab juanb Linux - General 1 06-05-2004 09:29 AM
crontab does not work need help Xris718 Linux - General 10 04-18-2004 08:55 PM
crontab won't work John Galt Linux - General 32 08-20-2003 01:44 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:58 PM.

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