From 7f1c51fc27dd50ae5ea11e84dcb561c1ffc47f1c Mon Sep 17 00:00:00 2001 From: julien Date: Tue, 14 Jan 2025 18:01:34 +0100 Subject: [PATCH] first commit --- README.md | 3 +++ sbin/vol-compress | 9 +++++++++ sbin/vol-extract | 8 ++++++++ sync.sh | 3 +++ 4 files changed, 23 insertions(+) create mode 100644 README.md create mode 100755 sbin/vol-compress create mode 100755 sbin/vol-extract create mode 100755 sync.sh 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