Skip to content

Instantly share code, notes, and snippets.

@dpwrussell
Created April 9, 2014 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpwrussell/10263524 to your computer and use it in GitHub Desktop.
Save dpwrussell/10263524 to your computer and use it in GitHub Desktop.
BTRFS Snapshot
#!/bin/bash
set -e
if grep -qs '/media/btrfs-root' /proc/mounts; then
echo "It's mounted"
else
mount /media/btrfs-root
fi
cd /media/btrfs-root
stamp=`date +%Y_%m_%d-%H_%M_%S`
btrfs subvolume snapshot @ root_snapshot_${stamp}
#umount /media/btrfs-root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment