From 9cd4f285688a1f92684b7dda9724759b66edf656 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Wed, 11 Jul 2018 08:49:49 +0000 Subject: various changes - make domain name configurable - prepend RBU to global veriables - cleanup --- profiles/backup-archive | 2 +- profiles/backup-cleanup | 2 +- profiles/backup-mysql | 4 ++-- profiles/backup-pgsql | 4 ++-- profiles/backup-sync | 13 ++++++------- 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'profiles') diff --git a/profiles/backup-archive b/profiles/backup-archive index 7d7a81a..f9e0be7 100755 --- a/profiles/backup-archive +++ b/profiles/backup-archive @@ -11,5 +11,5 @@ DEST="$(hostname).${DATE}.tar.gz${SUFFIX}" if [ "$(date +%d)" = "01" ]; then echo "Archiving montly backup" - ssh "$BACKUP_SERVER" install -Dm644 "$FQDN"/week/"$SRC" "$FQDN"/month/"$DEST" + ssh "$RBU_SERVER" install -Dm644 "$FQDN"/week/"$SRC" "$FQDN"/month/"$DEST" fi diff --git a/profiles/backup-cleanup b/profiles/backup-cleanup index b590b22..0199aaa 100755 --- a/profiles/backup-cleanup +++ b/profiles/backup-cleanup @@ -1,4 +1,4 @@ #!/bin/sh echo "Removing mysqldump file" -rm -f $BACKUP_CACHE/mysql.sql +rm -f $RBU_CACHE/mysql.sql diff --git a/profiles/backup-mysql b/profiles/backup-mysql index 3c4e232..097f99b 100755 --- a/profiles/backup-mysql +++ b/profiles/backup-mysql @@ -1,9 +1,9 @@ #!/bin/sh if [ -n "$MYSQL_PASSWORD" ]; then - echo "Dumping databases to: $BACKUP_CACHE/mysql.sql" + echo "Dumping databases to: $RBU_CACHE/mysql.sql" mysqldump -u root -p${MYSQL_PASSWORD} --all-databases -r \ - $BACKUP_CACHE/mysql.sql + $RBU_CACHE/mysql.sql else echo "MySQL password not set, skipping mysqldump." fi diff --git a/profiles/backup-pgsql b/profiles/backup-pgsql index 89fa6a3..dad9401 100755 --- a/profiles/backup-pgsql +++ b/profiles/backup-pgsql @@ -6,8 +6,8 @@ # Set GZIP to pigz for multi core compression (if installed) if [ -n "$PGPASSWORD" ]; then - echo "Dumping PostgreSQL database to: $BACKUP_CACHE" - pg_dump | ${GZIP:-gzip} > "$BACKUP_CACHE"/dump.sql.gz + echo "Dumping PostgreSQL database to: $RBU_CACHE" + pg_dump | ${GZIP:-gzip} > "$RBU_CACHE"/dump.sql.gz else echo "PostgreSQL password not set, skipping pg_dump." fi diff --git a/profiles/backup-sync b/profiles/backup-sync index d4514ea..394d667 100755 --- a/profiles/backup-sync +++ b/profiles/backup-sync @@ -3,17 +3,16 @@ echo "Sending backup to backup server" # make sure the destination directory exists -ssh "$BACKUP_SERVER" mkdir -p $FQDN/week +ssh "$RBU_SERVER" mkdir -p $FQDN/week # get the name of the renamed backup and also rename # this backup on the remote to prevent dulpicate upload -CURR_BACKUP=$(ls -t "$BACKUP_LOCATION" | sed -n 2p) +CURR_BACKUP=$(ls -t "$RBU_LOCATION" | sed -n 2p) if [ -n "$CURR_BACKUP" ]; then - HOSTNAME=$(hostname) - ssh "$BACKUP_SERVER" mv -f \ - $FQDN/week/$HOSTNAME.apkovl.tar.gz${SUFFIX} \ + ssh "$RBU_SERVER" mv -f \ + $FQDN/week/$(hostname).apkovl.tar.gz${SUFFIX} \ $FQDN/week/$CURR_BACKUP fi -rsync -av --delete-after "$BACKUP_LOCATION/" \ - "$BACKUP_SERVER":"$FQDN"/week +rsync -av --delete-after "$RBU_LOCATION/" \ + "$RBU_SERVER":"$FQDN"/week -- cgit v1.2.3