How to submit cron jobs?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to submit cron jobs?
# 1  
Old 04-21-2006
How to submit cron jobs?

How can I write a script to submit a perl script as a cron job but only have it execute once?

After it has executed once, I would like it to automatically insert itself again into cron.

I want to avoid the situation where I schedule a cron job to run once a day, but end up with multiple instances of the cron job because it requires more than 24 hours to execute.

Thanks,
Siegfried
# 2  
Old 04-21-2006
just have your perl script check to see if it is already running. if so then don't run.
# 3  
Old 04-21-2006
How do I check to see if it is still running?

Let is supposed I set a flag in a database and I clear the flag when the perl script exits.

What happens if the perl script access violates and executes before it clears the flag?

Then I will never run thinking I am already running!

Thanks,
Siegfried
# 4  
Old 04-21-2006
Install a signal handler that looks for SIGINT, or whatever, and delete the file there. I don't program for a living so I can't give you expert advice there.
# 5  
Old 04-21-2006
Just an idea

Put your job in a loop inside a shell script. Trap your error of your perl script in the loop. Put this shell script on cron.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron Jobs

How to see which cron jobs are not running? (2 Replies)
Discussion started by: rahul.raj1989
2 Replies

2. Red Hat

Cron jobs

I'm running cronjobs on a redhat 5.X. Cronjobs are getting failed frequently so how to find the root cause (2 Replies)
Discussion started by: karthik9358
2 Replies

3. Solaris

Cron jobs and at jobs

There are two jobs in Solaris , Cron and at jobs.. I know how to disable or enable cron jobs. How can I enable at jobs and disable it. Kindly help. Rj (2 Replies)
Discussion started by: jegaraman
2 Replies

4. Shell Programming and Scripting

cron jobs

Hi, please help on this am trying to exec the below mentioned cron jobs but its getting failed fro the past two days ###but when am trying to execte the cron by the times 23,29 18 * * * /export/home/inrvgo/thelak/China.sh its getting exec properly please help on this #... (8 Replies)
Discussion started by: thelakbe
8 Replies

5. Linux

Cron jobs

Hi, I am a Linux administrator (newbie) in my company. The distro being used in the servers here is Centos 5.3 Just need to know, as a Linux administrator is it better for me to use /etc/crontab to set my cron jobs. I do not want to use the crontab -e to schedule my cron jobs. That means... (1 Reply)
Discussion started by: anaigini45
1 Replies

6. UNIX for Dummies Questions & Answers

cron jobs

Hi, We have a group of hosts using which the cron jobs are submitted... Few days ago i had submitted a cron job in of these hosts, but unfortunately forgot the host name :( Can anyone please help me out in finding this host name from which the cron s submitting the job, i dont want the... (2 Replies)
Discussion started by: bhavanisree
2 Replies

7. Solaris

cron jobs

how to Put a cron entry which should be same script triggered on every Saturday and 1st of every month at 01.00 GMT. 0 2 1 * 6 --( At 2.00 GMT every sat & on 1st of every month) the above syntax is correct? Thanks (1 Reply)
Discussion started by: kurva
1 Replies

8. UNIX for Advanced & Expert Users

cron jobs...

I need to start a job every friday night at 8:00 P.M , it runs all the day on Sat and Sun....can somebody tell me how to do this...I understand crontab...but haven't used it.........can u write some steps.....how to create a file and call.....I honestly dont know? Plz help.Thanks (2 Replies)
Discussion started by: RubinPat
2 Replies

9. Linux

cron jobs

I created a php script. I'd like to have it run as a cron job every day at 10:30am. So i added 30 10 * * * /script.php to the cron file Is it possible to run the script on the command line to test it out ? (1 Reply)
Discussion started by: dannyd
1 Replies

10. Solaris

Cron Jobs

whats up, Have some questions about cron jobs, I am fairly new to the unix os. My cronjob sends all output to my mail, does anyone know how to redirect output to come out on the screen??? Thanks...... (6 Replies)
Discussion started by: lewisoco
6 Replies
Login or Register to Ask a Question