Hi,
I use a homemade script (see below). It’s not ideal but works for me.
The destination in my case is a "local” ZFS pool on file “vddv device" on a NFS
share. The NFS filesystem is provided by a ZFS appliance and snapshoted daily.
/opt/local/sbin/backup_zones_nfs.sh:
#!/usr/bin/bash
SOURCE_DS="zones"
DEST_DS="smartos_backup"
SNAP_PREFIX="backup_"
SNAP_FILE="/var/lib/zfs_zones_backup"
SDAT=`date +"%Y_%m_%d_%Hh%M"`
OLD_SNAP=`cat $SNAP_FILE`
#take the recursive snapshot that will be sent
zfs snapshot -r ${SOURCE_DS}@${SNAP_PREFIX}$SDAT
#exclude some elements from the snapshot (those won't be backedup)
#zfs destroy ${SOURCE_DS}/swap@${SNAP_PREFIX}$SDAT
zfs destroy -r ${SOURCE_DS}/backups@${SNAP_PREFIX}$SDAT
zfs destroy -r ${SOURCE_DS}/no_backup@${SNAP_PREFIX}$SDAT
zfs send -R -i @${SNAP_PREFIX}${OLD_SNAP} ${SOURCE_DS}@${SNAP_PREFIX}$SDAT |zfs
receive -Fu ${DEST_DS}
# still to be tested bash PIPESTATUS is an array of exit codes of each elem in
the pipe chain
#look at exit code of second elem in pipe chain (return of zfs receive)
#rem zfs send will allways return 1 because of warning caused by zfs destroy -r
${SOURCE_DS}/backups@...
if [ "${PIPESTATUS[1]}" == "0" ]
then
echo "${SOURCE_DS}@${SNAP_PREFIX}$SDAT sync succeeded."
rm $SNAP_FILE.old
mv $SNAP_FILE $SNAP_FILE.old
echo "$SDAT" > $SNAP_FILE
fi
On 4 mars 2015, at 21:27, Chris Ridd via smartos-discuss
<[email protected]> wrote:
> Hi,
>
> I've got a system with 2 pools - zones and backup - and I'd like to have
> something that sends regular snapshots from zones to backup. The pools are
> currently in the same box, which I'll happily admit is less than ideal.
>
> What do people like using for this in SmartOS? How do they get it running in
> the GZ?
>
> Thanks for any suggestions,
>
> Chris
>
> -------------------------------------------
> smartos-discuss
> Archives: https://www.listbox.com/member/archive/184463/=now
> RSS Feed: https://www.listbox.com/member/archive/rss/184463/23529323-02f95a03
> Modify Your Subscription: https://www.listbox.com/member/?&
> Powered by Listbox: http://www.listbox.com
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com