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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crontab Error?

Status
Not open for further replies.

pmcmicha

Technical User
May 25, 2000
353
0
0
I am getting the following error when attempting to use crontab in this manner on one of the servers I use:

su ${LOGIN} -c "crontab -l > ${DIR}/${FILE}"

UX:crontab: ERROR: Cannot determine current directory.

This is not a problem on any of our other servers which are configured the same. I did find that if I use the following syntax, this does not happen:

su - ${LOGIN} -c "crontab -l > ${DIR}/${FILE}"


I have verified ownership/permissions of /usr/bin/crontab as well as file size and its correpsonding sum value which all match our other servers. I checked SCO's site for anything that might pertain to this issue, but I did not find anything. Does anyone else have any ideas about this?

Thanks in advance.
 
5.0.4 thru 5.0.6 have a patch available. Don't know if it will resolve this problem. Ed Fair
unixstuff@juno.com
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Sorry, forgot to give the version that I am running:

SCO Unixware 7.1.1
 
I'm pretty sure this is because you are issuing the command from a directory in which the user does not have 'execute' permission (in this case affecting the ability to read the current directory). The problem goes away when you use 'su -' because the command gets run from the user's home directory.

Assuming this is in a script, and there is a reason not to use 'su -' you could simply put 'cd /tmp' before issuing the crontab command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top