+ Responder ao Tópico



  1. #1

    Padrão Crontab

    Bom, olhei outros tópicos antes de postar.

    Código :
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root
    HOME=/
     
    # For details see man 4 crontabs
     
    # Example of job definition:
    # .---------------- minute (0 - 59)
    # |  .------------- hour (0 - 23)
    # |  |  .---------- day of month (1 - 31)
    # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
    # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    # |  |  |  |  |
    # *  *  *  *  *  command to be executed
    30 23 * * * sarg.sh
    Então, meu script ta executável e dentro da pasta sbin; script bem simples

    Código :
    #!/bin/bash
    sarg -f /etc/sarg/sarg.conf
    exit 0
    Sera que esta tudo certo? não estou afim de gerar um relatório agora.

    Abraço.

    EDIT:

    Tentei um teste:
    [root@server ~]# /etc/rc.d/init.d/dhcpd status
    dhcpd (pid 1974) está em execução...

    #Adicionei a linha
    00 11 * * * /etc/rc.d/init.d/dhcpd stop

    #Reiniciei o serviço
    /etc/rc.d/init.d/crond restart

    #Esperei, e não deu certo.
    [root@server ~]# /etc/rc.d/init.d/dhcpd status
    dhcpd (pid 1974) está em execução...

    EDIT:

    Só adicionar root que funcionou
    00 11 * * * root /etc/rc.d/init.d/dhcpd stop

    Pode fechar, deletar...


    Abraços.
    Última edição por crisdmc; 10-07-2010 às 11:26.

  2. #2

    Padrão Re: Crontab

    vc SEMPRE precisa colocar o path completo para os scripts funcionarem:

    30 23 * * * /path.para/sarg.sh