Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Building ignored hosts filter
- HOSTS=$(echo -e "${IGNORED_HOSTS}" | grep -Ev "^$" | tr '\n' ' ' | sed -e 's/^/\^/g; s/$/\$/g; s/\ /\$\|\^/g;');
- if [ -z ${HOSTS} ]; then
- IHOSTS="^$";
- else
- IHOSTS="(${HOSTS})";
- fi;
- # Building ignored paths filter
- PATHS=$(echo -e "${IGNORED_PATHS}" | grep -Ev "^$" | tr '\n' ' ' | sed -e 's/^/\^/g; s/$/\$/g; s/\ /\$\|\^/g;');
- if [ -z ${PATHS} ]; then
- IPATHS="^$";
- else
- IPATHS="(${PATHS})";
- fi;
- # Getting subfolders, filtering out ignored
- HOSTS=$( cd ${LOGS}; find . -maxdepth 1 -type d | cut -c3- | grep -Ev "(${IHOSTS})" | sort);
- # Looping through subfolders to get filenames
- for i in $(echo -e "${HOSTS}"); do
- # Looping through filenames to get unique paths within 30 days
- for j in $( cd ${LOGS}/${i}; find . -mtime -30 -type f | sed -re 's/^\.\///g; s/\-[0-9]{8}\.gz$//g;' | sort | uniq ); do
- # Checking if new files exists
- if [ $(echo -e "${i}/${j}" | grep -Ec "(${IPATHS})") -eq 0 ] && [ $( find ${LOGS}/${i}/${j}* -mtime -1 -type f | wc -l ) -lt 1 ]; then
- ERRORS=$((${ERRORS}+1));
- if [ ${ERRORS} -eq 1 ]; then draw_line; fi;
- echo -e " === Check failed: ${LOGS}/${i}/${j}";
- fi;
- done;
- done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement