From 90890fb5d3deb63f6afcd9c8f15430d6d440d1af Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Sat, 19 Aug 2023 12:03:58 +0200 Subject: [PATCH] feat: print time at start of backup --- run-backup.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/run-backup.sh b/run-backup.sh index 8093c1c..cb3d1a1 100755 --- a/run-backup.sh +++ b/run-backup.sh @@ -1,10 +1,24 @@ #!/bin/bash +echo "Running backup at $(date)" + if [[ -v KOPIA_PG_DATABASE ]]; then + echo "Dumping database ${KOPIA_PG_DATABASE}" PGPASSWORD=$KOPIA_PG_PASSWORD pg_dump --host=$KOPIA_PG_HOST --username=$KOPIA_PG_USER $KOPIA_PG_DATABASE > /backup/database/$KOPIA_PG_DATABASE.sqldump || exit 1 fi +if [[ -v KOPIA_FTP_HOST ]]; +then + echo "Downloading from ftp server ${KOPIA_FTP_HOST}" + + lftp -u "$KOPIA_FTP_USER","$KOPIA_FTP_PASSWORD" $KOPIA_FTP_HOST <