Fix backup script: remove unnecessary database name from filename
This commit is contained in:
parent
5b172385ca
commit
d150b7c25e
1 changed files with 2 additions and 2 deletions
|
|
@ -45,10 +45,10 @@ if [ `docker exec -i $CONTAINER test -e /usr/bin/mariadb-dump && echo "yes" || e
|
||||||
--events \
|
--events \
|
||||||
--routines \
|
--routines \
|
||||||
--single-transaction \
|
--single-transaction \
|
||||||
--triggers | restic backup --stdin --stdin-filename=$DBTYPE_$CONTAINER_$DB_NAME.sql
|
--triggers | restic backup --stdin --stdin-filename=$DBTYPE_$CONTAINER.sql
|
||||||
elif [ `docker exec -i $CONTAINER test -e /usr/bin/pg_dump && echo "yes" || echo "no"` = "yes" ]; then
|
elif [ `docker exec -i $CONTAINER test -e /usr/bin/pg_dump && echo "yes" || echo "no"` = "yes" ]; then
|
||||||
DBTYPE="pgsql"
|
DBTYPE="pgsql"
|
||||||
docker exec -i $CONTAINER pg_dump --username=$DB_USER --password=$PGPASSWORD $DB_NAME | restic backup --stdin --stdin-filename=$DBTYPE_$CONTAINER_$DB_NAME.sql
|
docker exec -i $CONTAINER pg_dumpall --username=$DB_USER --password=$PGPASSWORD | restic backup --stdin --stdin-filename=$DBTYPE_$CONTAINER.sql
|
||||||
else
|
else
|
||||||
echo "Unsupported database type or database client not found in the container."
|
echo "Unsupported database type or database client not found in the container."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue