From 16beebdedcab715dedb0196d848eccaf61449c77 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 1 Jun 2003 16:38:20 +0000 Subject: Handle empty stamp, and use it when run through cron.daily. --- localdumpsql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'localdumpsql') diff --git a/localdumpsql b/localdumpsql index ad4de22..a38a7a9 100755 --- a/localdumpsql +++ b/localdumpsql @@ -3,7 +3,7 @@ # /usr/local/sbin/localdumpsql # Copyright 2001-2003 Jonas Smedegaard # -# $Id: localdumpsql,v 1.12 2003-05-22 12:13:11 jonas Exp $ +# $Id: localdumpsql,v 1.13 2003-06-01 16:38:20 jonas Exp $ # # MySQL/PostgreSQL maintenance script # @@ -26,13 +26,13 @@ function usage() { # automagically configure when run from cron dirs case `dirname "$0"` in /etc/cron.daily) - stamp=daily + stamp="" ;; /etc/cron.weekly) - stamp=weekly + stamp="weekly" ;; /etc/cron.monthly) - stamp=monthly + stamp="monthly" ;; *) if [ $# -lt 1 -o $# -gt 4 ]; then @@ -94,7 +94,7 @@ for sqltype in $sqltypes; do chmod u=rX,go= "$targetdir" done for db in `${sqltype}_db_user "$databases" "$user"`; do - targetfile="$targetdir/$stamp.$db.sql" + targetfile="$targetdir/$db${stamp:+.$stamp}.sql" (set +e; ${sqltype}dump_user_db "$user" "$db"; set -e) > "$targetfile" chown "$user": "$targetfile" chmod u=r,go= "$targetfile" -- cgit v1.2.3