From: Sarah Hoffmann Date: Thu, 26 Apr 2012 22:03:15 +0000 (+0200) Subject: immediately exit on log rotation errors X-Git-Tag: deploy~702 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/7f6689071c35d970cfd541be695fd35efdf51e1b immediately exit on log rotation errors --- diff --git a/utils/cron_logrotate.sh b/utils/cron_logrotate.sh index 77102d98..b9291d95 100755 --- a/utils/cron_logrotate.sh +++ b/utils/cron_logrotate.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash -e # # Rotate query logs. @@ -8,7 +8,7 @@ basedir=`dirname $0` logfile=`date "+$basedir/../log/query-%F.log.gz"` # dump the old logfile -pg_dump -a -F p -t backup_query_log $dbname | gzip -9 > $logfile || exit +pg_dump -a -F p -t backup_query_log $dbname | gzip -9 > $logfile # remove the old logs psql -q -d $dbname -c 'DROP TABLE backup_query_log'