commit 7f1c51fc27dd50ae5ea11e84dcb561c1ffc47f1c Author: julien Date: Tue Jan 14 18:01:34 2025 +0100 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e59705 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# scripts + +Execute `sync.sh` to copy scripts on the server. diff --git a/sbin/vol-compress b/sbin/vol-compress new file mode 100755 index 0000000..ebb9607 --- /dev/null +++ b/sbin/vol-compress @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ ! -d "volumes" ]; then + echo 'There is no data to archive ! Make sure you are in a service directory with persistent data (ie. must be a "volumes" directory there).' + exit +fi + +ARCHIVE=${PWD##*/}.tar.zst +tar --zstd -cf $ARCHIVE -C volumes . diff --git a/sbin/vol-extract b/sbin/vol-extract new file mode 100755 index 0000000..aefbed2 --- /dev/null +++ b/sbin/vol-extract @@ -0,0 +1,8 @@ +#!/bin/bash + +ARCHIVE=${PWD##*/}.tar.zst +if [ -d "volumes" ]; then + rm -r volumes +fi +mkdir volumes +tar --zstd --same-owner -xvf $ARCHIVE -C volumes diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000..7fb65a7 --- /dev/null +++ b/sync.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cp sbin/* /usr/local/sbin