projects
/
zfs-ubuntu
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added replicate wrapper logfile.
[zfs-ubuntu/.git]
/
zfs-replicate-wrapper
diff --git
a/zfs-replicate-wrapper
b/zfs-replicate-wrapper
index d699c792e424197ecfb61ab9ac1952282b5915b0..a43e8fb75204542978af8ca62bdf00e0d679e36e 100755
(executable)
--- a/
zfs-replicate-wrapper
+++ b/
zfs-replicate-wrapper
@@
-6,8
+6,10
@@
# Setup some default values
zfsreplicate="/etc/bin/zfs-replicate"
# Setup some default values
zfsreplicate="/etc/bin/zfs-replicate"
+logdir="/var/log/zfs"
logfile_parser="/etc/bin/zfs-log-parser"
logfile_parser="/etc/bin/zfs-log-parser"
-logfile="/var/log/zfs/zfs-replicate.log"
+logfile="$logdir/zfs-replicate.log"
+mylogfile="$logdir/zfs-replicate-all.log"
remote="tank.pippins.net"
local_pool=backups
mailto=root@pippins.net
remote="tank.pippins.net"
local_pool=backups
mailto=root@pippins.net
@@
-21,11
+23,14
@@
naspool/www
naspool/git
'
naspool/git
'
-# Specify the maximum run time in minutes that this script can run
+# Specify the maximum run time in minutes that this script can run
(0=no limit)
maxruntime=240
# This function checks to see if our runtime has exceeded our stoptime
timeexceeded() {
maxruntime=240
# This function checks to see if our runtime has exceeded our stoptime
timeexceeded() {
+ if [[ $maxruntime == 0 ]]; then
+ return 0
+ fi
currenttime=`date +%s`
elapsedtime=$(($currenttime - $starttime))
stoptime=$(($maxruntime*60))
currenttime=`date +%s`
elapsedtime=$(($currenttime - $starttime))
stoptime=$(($maxruntime*60))
@@
-86,6
+91,7
@@
previous_backup_marker=@previous-backup-${local_pool_guid}
# Auto snapshot every zfs filesystem on the system specified below
echo "$date ZFS replicate started" >> $logfile
# Auto snapshot every zfs filesystem on the system specified below
echo "$date ZFS replicate started" >> $logfile
+echo "$date ZFS replicate started" | tee -a $mylogfile
# Sort the filesystems to replicate by the oldest backup first
tmpfile=`tempfile`
# Sort the filesystems to replicate by the oldest backup first
tmpfile=`tempfile`
@@
-98,13
+104,15
@@
rm -f $tmpfile
# Replicate the sorted filesystems
for filesystem in $sorted_filesystems; do
# Replicate the sorted filesystems
for filesystem in $sorted_filesystems; do
- echo "-> Replicating $remote:$filesystem to ${local_pool}/${filesystem}"
+ echo "-> Replicating $remote:$filesystem to ${local_pool}/${filesystem}"
| tee -a $mylogfile
replicate $remote $filesystem
done
# All done
echo `date` ZFS replicate complete >> $logfile
replicate $remote $filesystem
done
# All done
echo `date` ZFS replicate complete >> $logfile
+echo `data` ZFS replicate complete | tee -a $mylogfile
# Parse the log file and extract our backup stats
$logfile_parser "$logfile" "$date" >> $logfile
# Parse the log file and extract our backup stats
$logfile_parser "$logfile" "$date" >> $logfile
+$logfile_parser "$logfile" "$date" | tee -a $mylogfile