Operating System - HP-UX
1834939 Members
2372 Online
110071 Solutions
New Discussion

Re: Bizarre cron problem - script running

 
SOLVED
Go to solution
Robin King_1
Regular Advisor

Bizarre cron problem - script running

I've got a confusing problem with cron. I have two data transfer jobs. One needs to run everynight at 20:10 (overnight_transfer), and one is run adhoc (frontend_transfer).

I have created a specific user for these, and this is the crontab for that user:

10 20 * * * * /home/transfer/overnight_transfer

The problem I have, is that this isn't actually the job that runs, it runs /home/transfer/frontend_transfer instead. The cron log confirms what it says in cron:

> CMD: * /home/transfer/overnight_transfer
> transfer 14605 c Thu Apr 1 20:10:00 BST 2004

frontend_transfer was created by copying overnight_transfer, would this have anything to do with it?

Thanks

8 REPLIES 8
Robin King_1
Regular Advisor

Re: Bizarre cron problem - script running

I forgot to say, that if I run the /home/transfer/overnight_transfer manually, the correct script runs.
Robert-Jan Goossens
Honored Contributor

Re: Bizarre cron problem - script running

Hi Robin,

How did you edit you cron, cronab -e or vi.
Try restarting the crond.

# /sbin/init.d/cron stop
# /sbin/init.d/cron start

Regards,
Robert-Jan
T G Manikandan
Honored Contributor

Re: Bizarre cron problem - script running

Did you create a link or a copy that file.

Do you have any link inside the script pointing there?
Robin King_1
Regular Advisor

Re: Bizarre cron problem - script running

I used crontab -e.

The server reboots every morning as part of the backup schedule, so cron is being restarted every day.

I simply cp'd the file, and edited the copy.

I don't have any links.

Sanjay Kumar Suri
Honored Contributor

Re: Bizarre cron problem - script running

My suggestion is:

Run crontab -r for the user and then create again crontab entry with crontab -e

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Mark Grant
Honored Contributor
Solution

Re: Bizarre cron problem - script running

Your crontab entry is wrong. This could be a typo but it should read

10 20 * * * /home/transfer/overnight_transfer

You have too many "*"'s
Never preceed any demonstration with anything more predictive than "watch this"
Robin King_1
Regular Advisor

Re: Bizarre cron problem - script running

Sanjay, Mark, I'll try both of your suggestions. Thanks
Tomek Gryszkiewicz
Trusted Contributor

Re: Bizarre cron problem - script running

Crontab is trying to run program named: "*"... Delete one * and do like this:
10 20 * * * /home/transfer/overnight_transfer

-Tomek