Skip to content

Instantly share code, notes, and snippets.

@kalos
Created December 5, 2011 14:47
Show Gist options
  • Save kalos/1433816 to your computer and use it in GitHub Desktop.
Save kalos/1433816 to your computer and use it in GitHub Desktop.
create btrfs simple snapshot
#!/bin/bash
pool_btrfs=`mount -t btrfs | grep " / " | cut -d " " -f 1` && \
tmp=`mktemp -p /tmp -d bsnap-XXXX` && \
mount $pool_btrfs $tmp && \
btrfs subvol snapshot $tmp/@ $tmp/@bsnap_`date '+%Y-%m-%d_%H.%M'`${1} && \
umount $tmp && \
rmdir $tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment