Skip to content

Instantly share code, notes, and snippets.

@Rovanion
Forked from anonymous/snapshot.sh
Last active December 17, 2015 00:29
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 Rovanion/5521509 to your computer and use it in GitHub Desktop.
Save Rovanion/5521509 to your computer and use it in GitHub Desktop.
#!/bin/bash
LOGG=/home/fille/Loggar/snapshots.txt
touch $LOGG
exec >> $LOGG 2>&1
DATE=$(date +%Y%m%d)
echo ""
echo "Written by snapshot.sh"
echo "-------------------------"
date "+%Y-%m-%d %H:%M"
for POOL in private lagret os
do
zfs snapshot storage/$POOL@$DATE
if [ $? == 0 ]
then
echo "Snapshot of $POOL taken"
else
echo "SNAPSHOTTING PRIVAT FAILED!"
fi
done
echo "------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment