bin: update

This commit is contained in:
Luc Bijl 2025-08-17 15:01:12 +02:00
parent 0cc125394f
commit a93593061c
5 changed files with 35 additions and 3 deletions

10
bin/backup Executable file
View 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
View file

4
bin/dump Normal file → Executable file
View file

@ -2,7 +2,6 @@
command="/usr/bin/podman"
# Dumps 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"
done
# Exports volumes
volumes=""
for volume in $volumes
do
$command volume export $volume --output <home>/.volumes/${volume}.tar
$command volume export $volume --output /home/neutrino/.volumes/${volume}.tar
done

12
bin/load-databases Executable file
View 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
View 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