From 1b7d46781eba10fb48dd160129e80bf8148c85a7 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 28 Jan 2025 02:33:28 +0300 Subject: [PATCH] experimenting with btrfs snapshots... Signed-off-by: Alex A. Naanou --- Archive/snapshot.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 Archive/snapshot.sh diff --git a/Archive/snapshot.sh b/Archive/snapshot.sh new file mode 100755 index 00000000..8b5ce6ac --- /dev/null +++ b/Archive/snapshot.sh @@ -0,0 +1,21 @@ +#!/usr/bin/bash + +if ! [ -e ./media ] ; then + btrfs subvolume create ./media + # XXX build tree -- ImageGrid +fi +if ! [ -e ./.snapshots ] ; then + mkdir ./.snapshots +fi + +#DATE=`date +%Y%m%d-%H%M%S` + +SNAPSHOT=$(( + $( ls .snapshots \ + | sort -n \ + | tail -n 1 ) \ + + 1 )) + + +btrfs subvolume snapshot -r ./media .snapshots/${SNAPSHOT} +