• LINUX > cron

      éditer un cron

      crontab -e

      (re)lancer un script au démarrage de Linux

      @reboot en lieu et place du timer classique.

       

      0 * * * * sh /home/toto/un_script.sh
      @reboot sh /home/toto/script_pour_demarrage.sh

       

      Et script_pour_demarrage.sh contient les commandes pour lancer toutes les applications utiles :

      #!/bin/bash
      su -c "python /home/toto/blabla.py -d -f /home/toto/blabla.ini" -s /bin/sh blabla
      su -c "python /home/toto/bla.py -d --config_file /home/toto/bla.conf" -s /bin/sh bla
      su -c "python /home/toto/pinkfloyd.py -d" -s /bin/sh pinkfloyd

      su … au cas où l’on renseigne un crontab en root

      -d … lancement du script python en arrière plan (daemon)

      -f / --config_file … lancement avec le fichier de configuration machin.ini/conf

 

Aucun commentaire

 

Laissez un commentaire