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

cron job on server...not working *exactly* as i need...

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
i have a cron job set up to run a file that's under the folder - where all my website files are located.

i set up the cron job to run once a day - and it does, once a day. it runs a file that creates new files, to be saved in the folder.

if i run the file manually, by entering the location in the address bar, it works fine and the files are saved to the proper location. however, if i let the cron job run, the files are saved above the folder...i don't understand.

any ideas?

i also get this message that's emailed to me once the job is run:

perl/home/myusername
prototype mismatch: sub main::head: none vs($) at /home/myusername/pub

please help.

- g
 
Hi. Not sure about the perl problem, but as far as the cron job is concerned, because cron runs in a very limited environment, it is best to set all variables (PATH etc) explicitly in the script. These should match the variables available when running the script interactively (echo $PATH to see the relevant setting for example). It is also advisable to use full pathnames when specifying where to put output files, since by default they will be put in the home directory of the user running the job via cron.

Hope this helps - please post back if you need further assistance.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top