From b034c0933c770f2d36c258747aa3c3c0ad2f519e Mon Sep 17 00:00:00 2001 From: tbrehm Date: Thu, 25 Feb 2010 14:48:26 +0000 Subject: [PATCH] Fixed: FS#1060 - multiple execution of Fetchmail / Getmail causes high load --- server/scripts/run-getmail.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/scripts/run-getmail.sh b/server/scripts/run-getmail.sh index 998ecab733..274c0cb443 100644 --- a/server/scripts/run-getmail.sh +++ b/server/scripts/run-getmail.sh @@ -8,6 +8,12 @@ rcfiles="$rcfiles -r $file" fi done #echo $rcfiles -if [ "$rcfiles" != "" ]; then -exec /usr/bin/getmail -n -v -g /etc/getmail $rcfiles +if [ -f /tmp/.getmail_lock ]; then + echo 'Found getmail lock file /tmp/.getmail_lock, we quit here.' +else + touch /tmp/.getmail_lock + if [ "$rcfiles" != "" ]; then + exec /usr/bin/getmail -n -v -g /etc/getmail $rcfiles + fi + rm -f /tmp/.getmail_lock fi \ No newline at end of file -- GitLab