Automatically run scripts under Linux
⧼vector-jumptonavigation⧽
⧼vector-jumptosearch⧽
fr:Exécuter automatiquement des scripts sous Linux
This article has been created by an automatic translation software. You can view the article source here.
Problematic
You want to be able to call Linux commands, and scripts automatically, some days or hours.
Solution
Creating rules cron to inform the system of commands to run as well as the time or switching time.
- You first need to verify that your script is able to run command line.
- Then just insert in the file /etc/crontab, the path to the script and the hours of enforcement.
Here is the composition of a line cron:
[minute] [heure] [jour du mois] [mois] [jour de la semaine] [commande à lancer]
Examples
#Programmation du reboot soft tous les Lundi, Mardi, Jeudi, Samedi a 6h30 30 6 * * 1,2,4,6 root reboot #Programmation d'un script http appelé toutes les minutes */1 * * * * root GET http://votre-domaine.com/test.php
Enable comment auto-refresher