bin: update
This commit is contained in:
parent
0cc125394f
commit
a93593061c
5 changed files with 35 additions and 3 deletions
10
bin/backup
Executable file
10
bin/backup
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
host=""
|
||||||
|
user=""
|
||||||
|
serverdir=""
|
||||||
|
|
||||||
|
clientdirs="$HOME/.local/etc $HOME/.local/bin $HOME/.config $HOME/.volumes $HOME/.dump"
|
||||||
|
command="/usr/bin/restic"
|
||||||
|
|
||||||
|
exec $command -r sftp:${user}@${host}:/${serverdir} -v backup $clientdirs
|
0
bin/checkpod
Normal file → Executable file
0
bin/checkpod
Normal file → Executable file
4
bin/dump
Normal file → Executable file
4
bin/dump
Normal file → Executable file
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
command="/usr/bin/podman"
|
command="/usr/bin/podman"
|
||||||
|
|
||||||
|
|
||||||
# Dumps databases
|
# Dumps databases
|
||||||
|
|
||||||
postgres_databases=""
|
postgres_databases=""
|
||||||
|
@ -12,12 +11,11 @@ do
|
||||||
$command exec -it ${database}-pod-postgres sh -c "pg_dumpall -U postgres | gzip > /dump/${database}.sql.gz"
|
$command exec -it ${database}-pod-postgres sh -c "pg_dumpall -U postgres | gzip > /dump/${database}.sql.gz"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Exports volumes
|
# Exports volumes
|
||||||
|
|
||||||
volumes=""
|
volumes=""
|
||||||
|
|
||||||
for volume in $volumes
|
for volume in $volumes
|
||||||
do
|
do
|
||||||
$command volume export $volume --output <home>/.volumes/${volume}.tar
|
$command volume export $volume --output /home/neutrino/.volumes/${volume}.tar
|
||||||
done
|
done
|
||||||
|
|
12
bin/load-databases
Executable file
12
bin/load-databases
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
command="/usr/bin/podman"
|
||||||
|
|
||||||
|
# Loads dumped databases
|
||||||
|
|
||||||
|
postgres_databases=""
|
||||||
|
|
||||||
|
for database in $postgres_databases
|
||||||
|
do
|
||||||
|
$command exec -it ${database}-pod-postgres sh -c "gunzip -c /dump/${database}.sql.gz | psql -U postgres"
|
||||||
|
done
|
12
bin/load-volumes
Executable file
12
bin/load-volumes
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
command="/usr/bin/podman"
|
||||||
|
|
||||||
|
# Imports volumes
|
||||||
|
|
||||||
|
volumes=""
|
||||||
|
|
||||||
|
for volume in $volumes
|
||||||
|
do
|
||||||
|
$command volume import $volume /home/neutrino/.volumes/${volume}.tar
|
||||||
|
done
|
Loading…
Add table
Add a link
Reference in a new issue