Problemas com agendamento
Galera estou com um problema de agendamento aqui no meu server. Eu preciso que de hora em hora meu Courier seja reiniciado. Fiz um script da seguinte forma
Código :
#!/bin/bash
imap="/etc/init.d/courier-imap"
$imap restart
if [ $imap != 0 ]; then
date "+%d/%m/%Y %H:%M:%S ==> Courier-Imap reiniciado com SUCESSO" >> /var/log/server.log
else
date "+%d/%m/%Y %H:%M:%S ==> Courier-Imap nao reiniciado" >> /var/log/server.log
fi
authlib="/etc/init.d/courier-authlib"
$authlib restart
if [ $authlib != 0 ]; then
echo date "+%d/%m/%Y %H:%M:%S ==> Courier-AuthLib reiniciado com SUCESSO" >> /var/log/server.log
else
date "+%d/%m/%Y %H:%M:%S ==> Courier-AuthLib nao reiniciado" >> /var/log/server.log
fi
authdaemon="/etc/init.d/courier-authdaemon"
$authdaemon restart
if [ $authdaemon != 0 ]; then
date "+%d/%m/%Y %H:%M:%S ==> Courier-AuthAaemon reiniciado com SUCESSO" >> /var/log/server.log
else
date "+%d/%m/%Y %H:%M:%S ==> Courier-AuthDaemon nao reiniciado" >> /var/log/server.log
fi
e meu crontab esta da seguinte forma
Código :
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1
#
49 * * * * reiniciar.sh > /dev/null 2>&1
a linah que interessa no crontab é a ultima mas eu ja alterei ela de tudo quanto foi jeito que achei na net e não funcionou. Eu não sei mas o que fazer para este script funcionar por ja deu uma dor de cabeça razoavel isto ai. Se alguem puder me ajudar ficarei muito agradecido.
Desde ja agradeço