Merge branch 'fail_on_error'

This commit is contained in:
Michael Mandl 2022-10-09 14:43:10 +02:00
commit 7152a875c5
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
4 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@ lftp -u "$FTP_USER","$FTP_PASSWORD" $FTP_HOST <<EOF
set ssl:verify-certificate no set ssl:verify-certificate no
mirror --delete --parallel=4 --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR; mirror --delete --parallel=4 --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR;
exit exit
EOF EOF || exit 1
echo echo
echo "Transfer finished" echo "Transfer finished"
date date

View file

@ -4,7 +4,7 @@ BACKUP_DIR="/backup/database"
echo "Starting to backup mysql database" echo "Starting to backup mysql database"
mkdir --parents $BACKUP_DIR mkdir --parents $BACKUP_DIR || exit 1
mysqldump --single-transaction --host=$MYSQL_BACKUP_HOST --user=$MYSQL_BACKUP_USER --password=$MYSQL_BACKUP_PASSWORD $MYSQL_BACKUP_DATABASE > $BACKUP_DIR/$MYSQL_BACKUP_DATABASE.sqldump mysqldump --single-transaction --host=$MYSQL_BACKUP_HOST --user=$MYSQL_BACKUP_USER --password=$MYSQL_BACKUP_PASSWORD $MYSQL_BACKUP_DATABASE > $BACKUP_DIR/$MYSQL_BACKUP_DATABASE.sqldump || exit 1
echo "Mysql database backup finished" echo "Mysql database backup finished"

View file

@ -4,7 +4,7 @@ BACKUP_DIR="/backup/database"
echo "Starting to backup postgres database" echo "Starting to backup postgres database"
mkdir --parents $BACKUP_DIR mkdir --parents $BACKUP_DIR || exit 1
PGPASSWORD=$PG_PASSWORD pg_dump --host=$PG_HOST --username=$PG_USER $PG_DATABASE > $BACKUP_DIR/$PG_DATABASE.sqldump PGPASSWORD=$PG_PASSWORD pg_dump --host=$PG_HOST --username=$PG_USER $PG_DATABASE > $BACKUP_DIR/$PG_DATABASE.sqldump || exit 1
echo "Postgres database backup finished" echo "Postgres database backup finished"

View file

@ -1,13 +1,13 @@
#!/usr/bin/env sh #!/usr/bin/env sh
if [[ -n "$DO_FTP_BACKUP" ]]; then if [[ -n "$DO_FTP_BACKUP" ]]; then
sh /usr/local/etc/urbackup/ftp_backup.sh sh /usr/local/etc/urbackup/ftp_backup.sh || exit 1
fi fi
if [[ -n "$DO_MYSQL_BACKUP" ]]; then if [[ -n "$DO_MYSQL_BACKUP" ]]; then
sh /usr/local/etc/urbackup/mysql_backup.sh sh /usr/local/etc/urbackup/mysql_backup.sh || exit 1
fi fi
if [[ -n "$DO_POSTGRES_BACKUP" ]]; then if [[ -n "$DO_POSTGRES_BACKUP" ]]; then
sh /usr/local/etc/urbackup/postgres_backup.sh sh /usr/local/etc/urbackup/postgres_backup.sh || exit 1
fi fi