Skip to content

Instantly share code, notes, and snippets.

@pad92
Created October 5, 2012 12:51
Show Gist options
  • Save pad92/3839652 to your computer and use it in GitHub Desktop.
Save pad92/3839652 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
FTP_HOST='ftpback-rbx4-105.ovh.net'
ZFS_POOL='zroot'
GPG_USERID='0xA8331351'
for DIR in $(df -t zfs | awk '/\// {print $6}'); do
DIR_NAME=$(echo $DIR | sed 's#^/$#slash#' | sed 's#/##'| sed 's#/#_#g')
zfs set snapdir=visible $ZFS_POOL$DIR
if [ -d "$DIR/.zfs/snapshot/daily.0" ]; then
ftp $FTP_HOST <<- EOF
binary
put "| tar -cf - $DIR/.zfs/snapshot/daily.0 | gpg --batch -e -r $GPG_USERID -a -o -" /$DIR_NAME.gpg
exit
EOF
fi
zfs set snapdir=hidden $ZFS_POOL$DIR
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment