Commment restart httpd chaque 1/4heure

Bonjour,

j'ai un serveur didier Kimsufi chaque fois je restard httpd ( /etc/init.d/httpd restart ) manuellement via putty.exe .

je cherche un script au une commande de linux pour que mon serveur restart tous seul au

automatiquement tous les 15 minutes

merci beaucoup

4 réponses

  1. merci Franzux

    vous pouvez m'expliquer davantage je suis débutant

    merci
    0
    1. Modérateur
      Tu dois te connecter en root (su -/ sudo bash)
      et lancer "crontab -e" pour éditer le cron de root.
      Tu y introduis une ligne du style:
      0-45/15 * * * * /etc/init.d/apache2 restart
      qui signifie lancer la commande "/etc/init.d/apache2 restart" toutes les 15 minutes
      (ou reload; je connais pas ton but)
      [root@osiris ]/var/log# crontab -l | grep apache2 
      0-45/15 *  *  *  * /etc/init.d/apache2 restart 
      [root@osiris ]/var/log#grep apache2 /var/log/syslog 
      Dec 12 23:45:01 osiris /USR/SBIN/CRON[13905]: (root) CMD (/etc/init.d/apache2 restart) 
      

      Johan
      Gates gave ^H sold you the windows.
      GNU gave us the whole house.(Alexandrin)
      0
      1. merci jisisv

        je suis conecter sur root

        jai tapé crontab - e

        +

        a

        +
        */5 * * * * /etc/init.d/httpd restart >/dell/null 2>&1

        +
        ESC

        +

        :wq

        pour quité

        mais sa marche pas . je resoi des emails toutes les 5 minutes comme ça

        _____________________

        /bin/sh: /dell/null: No such file or directory

        ___________________________

        login as: root
        root@91.121.44.111's password:
        Last login: Tue Dec 13 13:08:41 2011 from tru75-4-82-227-169-230.fbx.proxad.net
        CentOS release 5.5 (Final)
        Linux ks300000.kimsufi.com 2.6.34.6-xxxx-std-ipv6-64 #3 SMP Fri Sep 17 16:19:12 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

        server : 35201
        ip : 91.121.44.111
        hostname : ks300000.kimsufi.com

        [root@ks300000 ~]#
        [root@ks300000 ~]#
        [root@ks300000 ~]#
        [root@ks300000 ~]# crontab-l
        -bash: crontab-l: command not found
        [root@ks300000 ~]# crontab -l
        [root@ks300000 ~]# crontab -e
        crontab: installing new crontab
        [root@ks300000 ~]#
        [root@ks300000 ~]#
        [root@ks300000 ~]#
        [root@ks300000 ~]# crontab -l
        0-45/15 * * * * /etc/init.d/apache2 restart
        [root@ks300000 ~]#
        0
        1. Modérateur
          >/dev/null 2>&1
          0