How to setup a cron job to execute a shell script?

Discussion in 'Installation/Configuration' started by manarak, Mar 3, 2013.

  1. manarak

    manarak Member

    I have successfully setup several cron jobs with URL cron, which seems to be working, but as far as of now, I still couldn't get shellscripts setup properly.
    I assume there are some permissions issues, but I'm unable to resolve them myself.

    Can someone please review how my server is installed and what I want to achieve and then tell me how to proceed?

    Debian 6 (installed as per Falko's perfect server How-To)
    with Jailkit installed (I believe this is relevant)
    ISPConfig upgraded to

    What I want to achieve:
    let's assume I got a directory /var/www/clients/client1/web1/cron/ where scripts that should be executed via CRON are stored

    let's assume I got script1.php and

    Question 1:
    how do I properly setup a cron job in ISPConfig3 interface to execute script1.php located at
    (I do not wish the script to be reachable by http: )

    Question 2:
    let's assume has to perform some tasks in some special directory such as
    /var/vmail/mailfilters/ to modify some files there.
    Same question, how do I setup the CRON job in ISPConfig3 interface?

    Thank you very much
  2. falko

    falko Super Moderator ISPConfig Developer

    /path/to/php /var/www/clients/client1/web1/cron/script1.php
    Make sure is executable. Specify the path to the script in the cron job:

Share This Page