Updated repository to the new configuration.
This commit is contained in:
parent
25dde6a119
commit
1945f193ea
31 changed files with 766 additions and 866 deletions
13
bin/checkpod
Normal file
13
bin/checkpod
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./conf
|
||||
|
||||
exec 2>&1
|
||||
|
||||
state=0
|
||||
|
||||
while [ $state == 0 ]
|
||||
do
|
||||
sleep 10
|
||||
$command pod inspect ${name}-pod | grep -q '"State": "Running"' || state=1
|
||||
done
|
23
bin/dump
Normal file
23
bin/dump
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
command="/usr/bin/podman"
|
||||
|
||||
|
||||
# Dumps databases
|
||||
|
||||
postgres_databases=""
|
||||
|
||||
for database in $postgres_databases
|
||||
do
|
||||
$command exec -it ${database}-pod-postgres sh -c "pg_dumpall -U postgres | gzip > /dump/${database}.sql.gz"
|
||||
done
|
||||
|
||||
|
||||
# Exports volumes
|
||||
|
||||
volumes=""
|
||||
|
||||
for volume in $volumes
|
||||
do
|
||||
$command volume export $volume --output <home>/.volumes/${volume}.tar
|
||||
done
|
23
bin/load
Normal file
23
bin/load
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
command="/usr/bin/podman"
|
||||
|
||||
|
||||
# Loads dumped databases
|
||||
|
||||
postgres_databases="gitea"
|
||||
|
||||
for database in $postgres_databases
|
||||
do
|
||||
exec $command exec -it ${database}-pod-postgres sh -c "gunzip -c /dump/${database}.sql.gz | psql -U postgres"
|
||||
done
|
||||
|
||||
|
||||
# Imports volumes
|
||||
|
||||
volumes="gitea-pod-gitea-data"
|
||||
|
||||
for volume in $volumes
|
||||
do
|
||||
exec $command volume import $volume <home>/.volumes/${volume}.tar
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue