ImageGrid/Archive/snapshot.sh
Alex A. Naanou 1b7d46781e experimenting with btrfs snapshots...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-01-28 02:33:28 +03:00

22 lines
331 B
Bash
Executable File

#!/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}