Dear, I ask for help, I did not find anything interesting in Google. In general, the task is this, my GVA (VDS) needs cron to run the php file on the site. The IPSManager panel, the settings are clear, but I don’t know which command to set, so that it runs , for example, sait.ru/123.php . I never worked with a crown, I appeal to you.

The debian-5.0-i386 system .

I would even be grateful to the manual)

    2 answers 2

    to get started as root:

    # crontab -e 

    And you write the rule:

     */1 * * * * /usr/bin/php-cgi /home/html/site.ru/123.php > /dev/null 2>&1 

    We save. This rule will run the script every minute. And then we read man cron, everything is very clearly written there. Must be installed php5-cli.

    • 2
      But why from the root? - Alex Kapustin
    • > ... / usr / bin / php-cgi ...>> Must be installed by php5-cli. Why then run through cgi? - Ilya Pirogov

    The main thing to decide from under some user is to run this script, from under the same as the site works or from under some other.

    If a user is selected, if it is a www-data pseudo-user, then put the script as root:

     # crontab -u www-data -e или # crontab -e www-data file 

    if from under the current user, then:

     $ crontab -e или $ crontab file 

    The actual file format is described in crontab , see man 5 crontab

    And as root, I strongly would not recommend running php scripts