Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron Job priority

Status
Not open for further replies.

ranjank

IS-IT--Management
May 9, 2003
176
IN
Hi,

Can anyone tell how to give priority to cron job.I have written a cronjob which copies the files to remote location at specified time.cornjob starts copying the job but after a while it goes in to sleeping mode.Any pointers on this will be highly appreciated.

Regards,
Ranjan.
 
Hi

The process priority can be set with the [tt]nice[/tt] command. But first I would look in the log files to see if something goes wrong that time. I do not think the [tt]nice[/tt] is a good solution such scheduled job related problems.

By the way, what kind of [tt]cron[/tt] are you using ?

Feherke.
 
You could renice it (see the man page), however I think it's unlikely to solve your problem. It's more likely to be network related...

Annihilannic.
 
What's 'sleeping mode'? Perhaps man nice for increasing the scheduling priority of the command.
 

Thanks for the reply.

Basically i have written a script from where crontab access it.crontab starts the transfer of file but after few minutes it stops copying,but i can see the rsync process running which i'm using for transfer.From where i can see the logs?

Regards,
Ranjan Khot.
 
Make your cron entry something like this:

[tt]01 23 * * * /path/to/your/script > /path/to/output/log 2>&1[/tt]

Then you can check the output log file.

Note that rsync can take a long time to check the differences between the remote and local copies, and it may *appear* to be doing nothing when it actually is.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top