experimenting with btrfs snapshots...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2025-01-28 02:33:28 +03:00
parent 1eac481159
commit 1b7d46781e

21
Archive/snapshot.sh Executable file
View File

@ -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}