Crontab




Crontab

Plan and manage automatated actions on your web hosting



Operation


With Crontab you can schedule tasks. This results in the automation of periodic updates, execution of programs, and the sending of emails...
As with the Windows Task Scheduler, you automate your updates and execution by choosing the date, time and frequency.

You can:

  • automate updates or run scripts
  • perform backups of your site and your databases
  • access information streams that update your site
  • verify the status of sensitive files to secure a site.
  • send emails containing access logs or links to backups


How do you use it?





You simply log in to your Manager and schedule all the tasks to be performed.

You can create or edit scripts to run periodically, it's as simple as that. You select the script, and the days and hours of execution for the script of your choice.



Advantages:

  • Enjoy Crontab on your shared hosting: This system, formerly reserved for users of dedicated servers, is available on shared hosting. OVH provides you with Personal, Pro, Business or Premium hosting and the possibility of using Cron! Making site and database backups when you want is now possible automatically. Simply select the script to run in the Manager and select the frequency.

  • Task tracking: From your manager, you can see if the tasks are executed successfully. In the case where the execution task fails, you will get error messages and can modify future tasks.


Note: You can run a task a maximum of once per hour.



Go further: example of a script that can be run to save and compress 2 databases:


<?php
system("mysqldump --host=your_mysql_server --user=your_database_name --password=password your_database_name > backup.sql");
system("gzip backup.sql");
system("mysqldump --host=your_mysql_server --user=your_database_name --password=password your_database_name > backupbase2.sql"); system("gzip backupbase2.sql");
?>

And in the manager you can choose to run it every week or every month, for example.