cronsentora

Setting up cronjobs in Sentora, to be performed at user defined time


I'm working with Sentora admin panel, and I'm trying to setup a cron job, at a specific time. For example, I want it to fire at 12:34 every day. However, the admin panel only allows me to chose the job's frequency from a dropdown list, and I can not type in my own.

enter image description here

Is it possible to set a custom, user-defined time?


Solution

  • There is no way to set a custom time from within the Sentora admin panel. The only way is via terminal, and

    crontab -e
    

    which opens up the crontab for the current user, in the default text editor (mine was Vim). After doing that, the cron can be setup in the usual manner. For example, for root user

    34 12 * * * php -q /var/sentora/hostdata/zadmin/public_html/your_site/cron.php > /dev/null 2>&1
    

    One important thing to note is that you should not edit the crontab file in a Windows text editor, since it seems to mess up the line endings, and then the cron won't run.