diff --git a/squid/squid-logrotate-script.sh b/squid/squid-logrotate-script.sh index 776970ab..ceaf7db6 100644 --- a/squid/squid-logrotate-script.sh +++ b/squid/squid-logrotate-script.sh @@ -10,6 +10,11 @@ fi logs_dst="/home/squid/`hostname`/logs" +if [ ! -d "$logs_dst" ]; then + echo "Destination des logs inexistante" + exit 42 +fi + while ( ls -tr "$logs_src" | grep -E 'access\.log\.[0-9]+\..z2?' ); do dernier_fichier=$logs_src/$(ls -tr "$logs_src" | grep -E 'access\.log\.[0-9]+\..z2?' | head -1)