Skip to content

Manage Cron Jobs (tasks)

Helpful feature for making crons

We recommend using crontab.guru editor for cron schedule expressions, if you know what you do.

Adding cron task

MyCloud functionality allows you to manage your project's active Cron Jobs (tasks) via the Scheduler menu. To add or remove a scheduled job select the required project in the MyCloud Dashboard, find Scheduler (1⃣) in the Server settings branch and open it, insert a cron command in the Command (2⃣) field and select the required frequency from the suggested options (3⃣) or specify another frequency in the appeared field by checking the Custom radio button (4⃣). When all the parameters are set up, click Add new scheduled job (5⃣) — done ✔, the cron job is added to the server configuration.

adding cron

Recommended way of cron recording

We recommend using a secure and correct way to add a cron task:

/usr/bin/php /srv/projects/example.com/public_html/admin_or_crontask.php --dispatch=some.dispatch_name --cron_password=s0m3S3cur3P4ssw0rd 
instead of
/usr/bin/curl "hXXp://example.com/admin_or_crontask.php?dispatch=some.dispatch_name&cron_password=s0m3S3cur3P4ssw0rd" 
for your cron's password not to be stored in the access.log file, make your URL shorter and easier to read/fix/understand and avoid the closing of a curl/wget connection (a cron will be cancelled in this case) by a web-server.

Extended settings for the CRON job

extended settings

Enable log file with task output

Enables log file for the cron task, if you need more information, than just error log. Check this log file in Scheduled jobs section in the bottom of the page. Error log always enabled and can be reached the same way.

log file

Timeout of the task

This option will

  • Timeout for the task parameter can limitate task execution time
    • Default: not limited, maximum: 300 sec
  • Count of retries in case of timeout awaliable if Timeout for the task is set
    • Default: 0, maximum: 3
  • Count of retries in case of error
    • Default: 0, maximum: 3

Active Cron Jobs (tasks) management

Every added cron task appears in the Scheduled Jobs list where you can see the Frequency (1⃣) of the cron task, the Command (2⃣) itself. You can also delete a cron task if it is no longer required by clicking Remove (3⃣). Inspect logs by clicking Log file (4⃣)

adding cron

Need assistance?

If you have a problem, need assistance with tweaks or a free consultation, if you just want to discuss your project with experts and estimate the outcome, if you're looking for a solution that reinforces your online business, we will help. Let us know through MyCloud.