Por que o trabalho do crontab parou durante a execução?

0

ano passado, ele pode gerar arquivos * Error.txt e sem limite este ano apenas adicionar novos switches no novo projeto e mudou para novo gerenciador de segurança. o que está errado no servidor syslog?

Linux version 2.6.32-573.22.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016

[root@xcpalx03 emerg]# service --status-all | grep cron
crond (pid  10487) is running...

o nome final do arquivo processado é -rw-r - r-- 1 raiz raiz 0 jun 19 09:05 ErrorEX-DATA-3-mem0.log-20180619.gz.txt

parou durante a execução e não pode mais executar a metade final do script

crontab job run with result
[root@xcpalx03 emerg]# ls | wc
    122     122    4585

standalone it can run and generate *Error.txt files
[root@xcpalx03 emerg]# ls | wc
    329     329   10680

autônomo processado da seguinte forma

./cps01fw01.log-20180619.gz
./EX-DATA-3-mem0.log-20180619.gz
./EX-DATA-4-mem0.log-20180619.gz
./EX-VOICE-1-mem0.log-20180619.gz
./EX-VOICE-2-mem0.log-20180619.gz
./Hot14ms01.log-20180619.gz
./KC-MX104-1-re0.log-20180619.gz
./localhost.log-20180619.gz
./MAPAPP01.log-20180619.gz
./new_c0101as01.log-20180619.gz
./new_c0103as05.log-20180619.gz

meu script

#!/bin/bash
if [ -d "/root/emerg" ]; then
  echo "emerg folder exist"
else
  mkdir /root/emerg
fi
yy='date +%C%y'
mm='date +%m'
dd='date +%d'
date1=$yy$mm$dd
cd /root/emerg
rm -f Error* || true
rm -f *.txt || true
rm -f *.html || true
cd /var/log/remote
for i in '(ls  -l  *$date1*;ls  -l  *.log) | grep -vE "cisco.log|cisco.txt" | /bin/awk '{if ($5 > 20) print $9}' | /usr/bin/uniq';
do
 echo ./"${i}"
 /usr/bin/zless ./"${i}"  | /bin/grep -E "emerg:" > /root/emerg/Error"${i}".txt;
done
cd /root/emerg
rm -f *Error.txt
for i in 'ls -l | /bin/awk '{if ($5 > 0) print $9}'  | /bin/cut  -c1-19 | /usr/bin/uniq';
do
 echo ./"${i}"
 /bin/cat ./"${i}"* > "${i}"Error.txt
done

/ var / log / cron log

Jun 19 09:13:01 xcpalx03 CROND[1522]: (root) CMD (cat /var/log/remote/*.log > /var/log/remote/cisco.txt)
Jun 19 09:14:01 xcpalx03 CROND[1614]: (root) CMD (cat /var/log/remote/*.log > /var/log/remote/cisco.txt)
Jun 19 09:15:01 xcpalx03 CROND[1651]: (root) CMD (/root/checkemerg.sh &)
Jun 19 09:15:01 xcpalx03 CROND[1652]: (root) CMD (tac /var/log/remote/*.log > /var/www/html/cisco_log/cisco.txt)
Jun 19 09:15:01 xcpalx03 CROND[1653]: (root) CMD (cat /var/log/remote/*.log > /var/log/remote/cisco.txt)
Jun 19 09:16:01 xcpalx03 CROND[1711]: (root) CMD (cat /var/log/remote/*.log > /var/log/remote/cisco.txt)

config crontab

[root@xcpalx03 emerg]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/root

# 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
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
5 * * * * root /root/checklogemerg.sh &
50 * * * * root /root/checklog.sh &
*/15 * * * * root /root/checkemerg.sh &
10 * * * * root /root/checkdown.sh &
10 * * * * root /root/checkcrit.sh &
    
por Prince Martin 19.06.2018 / 03:24

0 respostas