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 cpio failure

Status
Not open for further replies.

pam196

Technical User
Jul 1, 2002
25
GB
Hi

I am experiencing problems with a cronned cpio backup routine. Basically the routine echos inprogress to a flag and starts to run cpio on the server. At the end of the routine it should echo OK into the flag file - however it doesn't. Running the job manually results in success 100% of the time. How can I identify the problem further, or has anyone come across a similar problem with cron jobs against manual ones?

The cron job is in roots cron, so I'm pretty sure its not a permissions problem. When I run the job manually, I also run it as root.

Cheers
 
Possibly the problem is that cron doesn't have it's own environment variables, even when run as root. To make it behave as it does from the crontab, include the line:

. /.profile (note the space between . /, it's important)

in your script.

This should then pick up the necessary PATH variables etc. HTH.
 
Cheers for the quick response, I'll give it a go!

Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top