Difference between revisions of "Automatically run scripts under Linux"
Line 1: | Line 1: | ||
+ | <span data-link_translate_pl_title="Automatycznie uruchamiać skrypty pod Linuksem" data-link_translate_pl_url="Automatycznie+uruchamia%C4%87+skrypty+pod+Linuksem"></span>[[:pl:Automatycznie uruchamiać skrypty pod Linuksem]][[pl:Automatycznie uruchamiać skrypty pod Linuksem]] | ||
<span data-link_translate_ja_title="Linux のスクリプトを自動的に実行します。" data-link_translate_ja_url="Linux+%E3%81%AE%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%82%92%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%BE%E3%81%99%E3%80%82"></span>[[:ja:Linux のスクリプトを自動的に実行します。]][[ja:Linux のスクリプトを自動的に実行します。]] | <span data-link_translate_ja_title="Linux のスクリプトを自動的に実行します。" data-link_translate_ja_url="Linux+%E3%81%AE%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%82%92%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%BE%E3%81%99%E3%80%82"></span>[[:ja:Linux のスクリプトを自動的に実行します。]][[ja:Linux のスクリプトを自動的に実行します。]] | ||
<span data-link_translate_ar_title="تلقائياً بتشغيل البرامج النصية تحت لينكس" data-link_translate_ar_url="%D8%AA%D9%84%D9%82%D8%A7%D8%A6%D9%8A%D8%A7%D9%8B+%D8%A8%D8%AA%D8%B4%D8%BA%D9%8A%D9%84+%D8%A7%D9%84%D8%A8%D8%B1%D8%A7%D9%85%D8%AC+%D8%A7%D9%84%D9%86%D8%B5%D9%8A%D8%A9+%D8%AA%D8%AD%D8%AA+%D9%84%D9%8A%D9%86%D9%83%D8%B3"></span>[[:ar:تلقائياً بتشغيل البرامج النصية تحت لينكس]][[ar:تلقائياً بتشغيل البرامج النصية تحت لينكس]] | <span data-link_translate_ar_title="تلقائياً بتشغيل البرامج النصية تحت لينكس" data-link_translate_ar_url="%D8%AA%D9%84%D9%82%D8%A7%D8%A6%D9%8A%D8%A7%D9%8B+%D8%A8%D8%AA%D8%B4%D8%BA%D9%8A%D9%84+%D8%A7%D9%84%D8%A8%D8%B1%D8%A7%D9%85%D8%AC+%D8%A7%D9%84%D9%86%D8%B5%D9%8A%D8%A9+%D8%AA%D8%AD%D8%AA+%D9%84%D9%8A%D9%86%D9%83%D8%B3"></span>[[:ar:تلقائياً بتشغيل البرامج النصية تحت لينكس]][[ar:تلقائياً بتشغيل البرامج النصية تحت لينكس]] |
Revision as of 20:13, 24 January 2016
pl:Automatycznie uruchamiać skrypty pod Linuksem
ja:Linux のスクリプトを自動的に実行します。
ar:تلقائياً بتشغيل البرامج النصية تحت لينكس
zh:自动运行在 Linux 下的脚本
de:Automatische Ausführung von Skripten unter Linux
nl:Automatisch uitvoeren van scripts onder Linux
it:Eseguire automaticamente script sotto Linux
pt:Automaticamente executar scripts no Linux
es:Ejecutar automáticamente secuencias de comandos en Linux
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