Moss helps you manage and schedule cron jobs for your servers and websites.

Server cron jobs

Server cron jobs are typically used to run system-wide periodic administrative tasks. You can manage them from Moss at the 'Cronjobs' tab of your server.

E.g. you may want to free disk space by removing packages that were automatically installed to satisfy dependencies for other packages but that are no longer needed. For this, tell Moss to run apt -y autoremove as root with the frequency of your choice.

Let's see another example. If you're developing PHP applications and use composer to manage dependencies, you may want to update it to the latest version from time to time. In that case, tell Moss to run composer self-update as user root with the frequency of your choice. It will create the corresponding cron job on your server.

Easy, isn't it? You can edit or delete these cron jobs at any moment.

Site cron jobs

Some frameworks rely on your server's cron to allow you to run your code at specific times. You can manage these site-specific cron jobs from Moss at the 'Cronjobs' tab of your site.

The Laravel's scheduler is a good example of a site cron job. Setting it up in Moss is easy:

  • Command: php /home/<site-user>/sites/<your-site-name>/current/artisan schedule:run >> /dev/null 2>&1 
  • Frequency: Every minute 

Note that your site cron jobs run as the user of your website (<site-user>) and that Moss makes sure that the right version of php (the one your website uses) is the one being invoked 😄

Of course, you can edit or delete these cron jobs at any moment.

Did this answer your question?