-
-
Save Rovanion/5521509 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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