Skip to content

Instantly share code, notes, and snippets.

Created May 5, 2013 09:00
Show Gist options
  • Save anonymous/5520209 to your computer and use it in GitHub Desktop.
Save anonymous/5520209 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"
zfs snapshot storage/privat@$DATE
if [ $? == 0 ]
then
echo "Snapshot of privat taken"
else
echo "SNAPSHOTTING PRIVAT FAILED!"
fi
zfs snapshot storage/lagret@$DATE
if [ $? == 0 ]
then
echo "Snapshot of lagret taken"
else
echo "SNAPSHOTTING LAGRET FAILED!"
fi
zfs snapshot storage/os@$DATE
if [ $? == 0 ]
then
echo "Snapshot of os taken"
else
echo "SNAPSHOTTING OS FAILED!"
fi
echo "------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment