diff --git a/bin/backup b/bin/backup new file mode 100755 index 0000000..446e732 --- /dev/null +++ b/bin/backup @@ -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 diff --git a/bin/checkpod b/bin/checkpod old mode 100644 new mode 100755 diff --git a/bin/dump b/bin/dump old mode 100644 new mode 100755 index dfb9e8a..8b9ff7a --- a/bin/dump +++ b/bin/dump @@ -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 /.volumes/${volume}.tar + $command volume export $volume --output /home/neutrino/.volumes/${volume}.tar done diff --git a/bin/load-databases b/bin/load-databases new file mode 100755 index 0000000..df6d3b0 --- /dev/null +++ b/bin/load-databases @@ -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 diff --git a/bin/load-volumes b/bin/load-volumes new file mode 100755 index 0000000..04f7958 --- /dev/null +++ b/bin/load-volumes @@ -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