Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to run a scheduled task on my remote server from within Parallels Plesk Panel 9.2.2 and I am trouble trying to figure out what the correct path I should be using is. I tried the URL of the file (what you would type into the browser to find it) but that doesn't work.

Can someone please give me the format I should be using, eg username/root_directory/filename.php? Or any suggestions that I could use to investigate this issue further?

Any help would be greatly appreciated.

share|improve this question

migrated from stackoverflow.com Jul 15 '10 at 3:13

This question came from our site for professional and enthusiast programmers.

1 Answer 1

Cron runs programs, not web sites, so you must provide the path on disk to a command line program or script. You appear to have a PHP script so you have a number of alternatives:

1

Provide the path to the PHP CLI interpreter and pass your script as argument:

php /home/username/root_directory/filename.php

... or:

/usr/bin/php /home/username/root_directory/filename.php

2

Create a PHP shell script:

/home/username/filename.sh

... where filename.sh has "x" permission and looks like:

#!/usr/bin/php
<?php
echo “Hello World!”;
?>

3

Create a bash shell script:

/home/username/filename.sh

... where filename.sh has "x" permission and looks like:

#!/bin/sh
php /home/username/root_directory/filename.php

... or:

#!/bin/sh
/usr/bin/php /home/username/root_directory/filename.php

4

Run an app that can talk HTTP:

wget http://example.com/filename.php
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.