Skip to content

Instantly share code, notes, and snippets.

@gwpl gwpl/
Created Dec 10, 2018

What would you like to do?
Checks if amount of files in directory has changed, if not than it executes killall to let thing restart in a loop
counter_old="$(cat "$counterf")"
echo -n 'Missing: '
comm -23 <(sort -u sites_source.txt) <(ls -1|sort -u)|wc -l
echo -n 'Total: '
sort -u sites_source.txt|wc -l
echo -n 'Files: '
counter_new="$(find -type f |wc -l)"
echo ${counter_new} |tee "$tmpf"
df -h .
if cmp -s "$counterf" "$tmpf"; then
echo Counters SAME - Metric FAILED
echo Trying to reboot things
#killall -v
#killall -v
killall -v python
date --iso-8601=seconds
echo Counters differ - Metric OK
cat "$tmpf" > "$counterf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.