Skip to content

Instantly share code, notes, and snippets.

@cmlsharp
cmlsharp / snp
Last active August 29, 2015 14:06 — forked from erikw/snp
#!/usr/bin/env bash
# Runs a command wrapped with btrfs pre-post snapshots.
log_path="/var/local/log/snp"
date=$(date "+%Y-%m-%d-%H%M%S")
log_file="${log_path}/snp_${date}.log"
if (( EUID != 0 )); then
echo "This script must be run as root" 1>&2
exit 1
fi