Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Using Crontab on a Cloud Server
This guide details the use of Crontab (crons via SSH), available only on Managed Cloud, by default (there is also a task scheduler for all hosting plans).
Prerequisites
- Script files called by cron must be executable (CHMOD).
Full path
Cron jobs do not have access to the absolute path. Calling PHP without specifying the full path to the executable makes it impossible to run the task. You must specify
/opt/phpX.X/bin/phpby replacing X.X with the desired PHP version (/opt/php8.1/bin/php for example).
Other operations
For example:
List the cron jobs for the SSH user in question:
crontab -l -u UsernameEdit the cron jobs:
crontab -e -u UsernameReceive email notifications about the results of your cron jobs (add this to the beginning of the file):
MAILTO=e-mail@domain.xyz
Restore a backup
Infomaniak backs up your cron jobs for the last 7 days (once a day). If you accidentally delete a cron job, contact Infomaniak support to request a restoration, specifying the time and date of the deletion.
Link to this FAQ: https://faq.infomaniak.com/350
Has this FAQ been helpful?