diff --git a/backup.sh b/utils/backup.sh similarity index 96% rename from backup.sh rename to utils/backup.sh index 848c89116430ac7341cd6fe88d0ba7d7be75f7d7..c47f4fa3632c4d0bd4a3c370e436d994aca05188 100755 --- a/backup.sh +++ b/utils/backup.sh @@ -26,7 +26,7 @@ # The directory which the dump is to be stored to. Do not change it here. Use # the --backupdir=./my/dir/ option or an environment variable instead. -BACKUPDIR="${BACKUPDIR:-./backup}" +BACKUPDIR="${BACKUPDIR:-../backup}" # Iff this (environment) variable is "true" as lower-case, then this script also # outputs a machine readable status report. The variable can also be set by # giving the `--yaml` command line option. @@ -59,10 +59,10 @@ EOF # Config and command line parameter loading ################################### -. .config +. ../.config # load useful stuff - parses the commandline parameters and so on... -. patches/utils/patch_header.sh +. ../patches/utils/patch_header.sh echo "BACKUPDIR: $BACKUPDIR" echo "YAML: $YAML" @@ -105,7 +105,7 @@ function yaml_success() { #rm dumpfile.tmp # create backup dir if not exists -[ -d "$BACKUPDIR" ] || mkdir "$BACKUPDIR" || +mkdir -p "$BACKUPDIR" DATE=$(date -u --rfc-3339=ns | sed 's/ /T/g') BACKUPFILE=${BACKUPDIR}/${DATABASE_NAME}.${DATE}.dump.sql