Skip to content

Commit

Permalink
ops: by default, use Docker instead of Podman for database volume bac…
Browse files Browse the repository at this point in the history
…kups
  • Loading branch information
arcanemachine committed Oct 8, 2023
1 parent cd0617e commit 0d17aa8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions support/scripts/backups/postgres/backup-create-outside-container
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ show_help() {
The backup file will be created in the same directory as this script. It will be created with a timestamp in the filename.
- e.g. 'postgres--pg-dump-2022-11-05-06-23-37.dump'
To use Docker instead of Podman, pass '--docker' as the last positional argument."
To use Podman instead of Docker, pass '--podman' as the last positional argument."
}

if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
show_help
exit
elif [ "$1" = "--docker" ]; then
container_program=docker
else
fi

if [ "$1" = "--podman" ]; then
container_program=podman
else
container_program=docker
fi

echo "Creating backup in Postgres container volume directory '/var/lib/postgresql/backups/'..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The first positional argument must be the filename of the backup you want to res
- DO NOT pass in the full path. Just the filename.
- e.g. 'pg-dump-2022-11-01-08-57-30.dump'
To use Docker instead of Podman, pass '--docker' as the last positional argument."
To use Podman instead of Docker, pass '--podman' as the last positional argument."
}

if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
Expand All @@ -16,10 +16,12 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
elif [ "$1" = "" ]; then
show_help
exit 2
elif [ "$2" = "--docker" ]; then
container_program=docker
else
fi

if [ "$1" = "--podman" ]; then
container_program=podman
else
container_program=docker
fi

$container_program exec -it postgres /var/lib/postgresql/backups/backup-restore-inside-container "$1"

0 comments on commit 0d17aa8

Please sign in to comment.