Has anyone ever used the Crontab on plesk version 7.5.4 to excecute a .php at set intervals?
I know this isnt quite a .php question, so I have also posted this question in the general topic area of this forum.
I am trying to execute a file every day at a certain time. I have a linux server and use the Crontab program on the plesk control panel. I have created my scheduled task, I have set the time and the command line looks like this:
lynx -dump http://www.mywebsite.com/repeat/repeat.php
I get the following error:
Looking up http://www.mywebsite.com
Making HTTP connection to http://www.mywebsite.com
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://www.mywebsite.com/repeat/repeat.php
Any responses will be much appreciated.
Thanks
Mark
PHP & Crontab - Execute a file at a certain time daily
Moderator: General Moderators
-
mark.disney
- Forum Newbie
- Posts: 7
- Joined: Tue Oct 21, 2008 10:18 am
Re: PHP & Crontab - Execute a file at a certain time daily
When calling php scripts from cron I always have success with the CGI rather than calling the page in lynx.
Our servers are CentOS (RHEL) based so the locations might be slightly different
Here is the command for crontab
Then just schedule the cron job.
Our servers are CentOS (RHEL) based so the locations might be slightly different
Here is the command for crontab
Code: Select all
/usr/bin/php-cgi -q /path/to/file.php
-
mark.disney
- Forum Newbie
- Posts: 7
- Joined: Tue Oct 21, 2008 10:18 am
Re: PHP & Crontab - Execute a file at a certain time daily
I cant seem to find the /usr/bin/php-cgi -q, i keep getting the error "No such file or directory".
I manage to get the following working without showing any errors, except now it doesnt process my php in my repeat.php file?
lynx -dump /var/www/vhosts/mywebsite.com/httpdocs/repeat/repeat.php
Any suggestions?
Thanks
I manage to get the following working without showing any errors, except now it doesnt process my php in my repeat.php file?
lynx -dump /var/www/vhosts/mywebsite.com/httpdocs/repeat/repeat.php
Any suggestions?
Thanks