From 9892e46c2f2f11a79cb79215a88c938d6770d282 Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Thu, 6 Oct 2011 15:29:56 +0200 Subject: [PATCH] =?UTF-8?q?[squid/logrotate]=20=C3=A9choue=20si=20le=20r?= =?UTF-8?q?=C3=A9pertoire=20n'existe=20pas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: 76f19bbfb4c55a2d1d5b451de63d9085 darcs-hash:20111006132956-ffbb2-7d0233ff0d81aad5f91e5a1608f7b5f473cda270.gz --- squid/squid-logrotate-script.sh | 5 +++++ 1 file changed, 5 insertions(+) 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)