cancel
Showing results for 
Search instead for 
Did you mean: 

Cant work out correct path for use in Crontab

Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cant work out correct path for use in Crontab

I cant get crontab to work.

I have a PHP script on crofters base directory outside the cgi-bin and want crontab to run it.

here's what I have so far.

crontab is set up as.

MAILTO=cron@martek.force9.co.uk
5 * * * * /files/home/martek/myscript.php

crontab is trying to execute the file ok but cant find it.

I get an email saying

/files/home/martek/myscript.php
: not found

has anyone an idea why this is happening. I cant quite get my head round the paths issue.

the file is there if I call it via telnet it works fine.

thanks in advance.
4 REPLIES
N/A

Cant work out correct path for use in Crontab

OK... the path should be /files/homex/username/ where x is 1,2 or 3 according to the support document. However, I am led to believe that Telnet/SSH dumpes you elsewhere - if you login using telnet or SSH what does 'pwd' tell you?
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cant work out correct path for use in Crontab

when i pwd on telnet i get
/files/home/martek
as the reply no numbers at all.
N/A

Cant work out correct path for use in Crontab

OK - you have missed out the /usr/local/bin/php which tells it how to process the PHP file/
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cant work out correct path for use in Crontab

thanks that seems to have done the trick i am gotting somewhere now. :-)

One other issue is the file crontab reads it's settings from.

If this is not transfered as ASCII then crontab reads it ok and will also display the settings ok if you crontab -l in telnet, but it will not run.

make sure that the file is in ASCII and not Binary.