#!/bin/bash # backup glusterfs config BACKUP_SRC="/var/lib/glusterd /etc/fstab /etc/glusterfs /etc/hosts /etc/hostname"; bakfile=''; bakdir=/etc/glusterfs/.bak; [ -d "$bakdir" ]||mkdir $bakdir; date +%Y-%m-%d-%H-%M-%S>$bakdir/volume.info; gluster volume info >>$bakdir/volume.info; [ -z "$bakfile" ]&&bakfile=`date +%Y-%m-%d-%H-%M-%S`; find $BACKUP_SRC |tar zcf ${bakfile}.tar.gz -T - --null;
沒有留言:
張貼留言