Cron job

Hi everybody,

We have a script which fetch the data from db. Below is the scenario where in the script has to be run by cron.

Schedule script to run every minute from 5min-59min in the first hour of the day and then 0-59 for every other hour.

Please let me know if any info required.

Reg,
Mastan

There's nothing to stop you putting two cron job entries; one for the first hour's schedule and a second one for the rest of the day. You can call exactly the same script in both.

This is quite simple unless I've missed something somewhere?

Hi,

I am new to cron job. It will be great if you write the cront tab entires.

Reg,
Mastan

 
 5-59 0 * * * <full path to script>
 0-59 1-23 * * * <full path to script>
 

First entry schedules the first hour
Second entry hours 1 thru' 23

NOTE: This schedules every day, ie,7 days a week.

If you're new to cron also note that you must set all variables needed in your script. Cron knows NOTHING about variables set on interactive login such as those set in .profile.

Ideally, DON'T edit crontabs directly otherwise you may need to wait up to 24 hrs for the job to run.
Use the proper crontab tools if you can.

Hope that helps.