Operating System - HP-UX
1847167 Members
6197 Online
110263 Solutions
New Discussion

Re: cronfile not executing

 
Bill Kiple
New Member

cronfile not executing

When I check mail I get the follwing concerning my cron jobs. Cron: can't change directory to your home directory. Unable to execute the command. I did change root's home directory earlier this week. Could this have something to do with it.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: cronfile not executing

I think cron is still using the old $HOME. Man crontab says:

"cron invokes the command from the user's HOME directory"

I would suggest re-loading your crontab with "crontab -r" followed by "crontab (cronfilename)".

Pete

Pete
Patrick Wallek
Honored Contributor

Re: cronfile not executing

It is possible. What are the permissions on roots new home dir?
justin berkman
Frequent Advisor

Re: cronfile not executing

hi guys
change the permission
to the new home directory
example of cron job :

00 23 * * 1,2,3,4,5 /home/BACKUP/creadirbackup 1>/tmp/back.log
#10 23 * * 1,2,3,4,5 /home/BACKUP/moves 1>/tmp/back.log
justin berkman
Frequent Advisor

Re: cronfile not executing

hi guys
can you attach a output file
John Bolene
Honored Contributor

Re: cronfile not executing

do a crontab -e and put in absolute pathnames for the file to execute

it probably is still pointing to the old path name
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Adam J Markiewicz
Trusted Contributor

Re: cronfile not executing

Yep, John's idea sounds good.

I'm not sure if just simple reloading coronfile will do the trick. If it uses $HOME, it is environement variable, so it won't be changed until real process restart, I'm affraid. but absolute paths are always accurate.

Good luck

Adam
I do everything perfectly, except from my mistakes
Niraj Kumar Verma
Trusted Contributor

Re: cronfile not executing

Hi,

I agree with Adam !!!
I have seen several problem with path in crontab and the solution was absolute path name.

-Niraj
Niraj.Verma@philips.com