projects
/
zfs-ubuntu
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e5bbf19
)
Added variable for the name of the local backup pool name
author
Alan J. Pippin
<ajp@pippins.net>
Mon, 12 Jan 2009 06:23:39 +0000
(23:23 -0700)
committer
Alan J. Pippin
<ajp@pippins.net>
Mon, 12 Jan 2009 06:23:39 +0000
(23:23 -0700)
zfs-replicate
patch
|
blob
|
history
diff --git
a/zfs-replicate
b/zfs-replicate
index ef90b54a40148d6077fe6655348654a3610520e1..7f93696da6b12e29119e9a56236913ff02b4bd26 100755
(executable)
--- a/
zfs-replicate
+++ b/
zfs-replicate
@@
-6,6
+6,9
@@
set -x
remote=$1
remote_fs=$2
remote=$1
remote_fs=$2
+# change to match the name of the local backup pool
+local_pool=backups
+
# The ssh connection doesn't find zfs without this.
zfs=/usr/sbin/zfs
# The ssh connection doesn't find zfs without this.
zfs=/usr/sbin/zfs
@@
-19,8
+22,8
@@
ssh $remote \
# List the snapshots on the local machine.
local_list=$(mktemp /tmp/replicate.XXXXXX)
$zfs list -H -t snapshot |
# List the snapshots on the local machine.
local_list=$(mktemp /tmp/replicate.XXXXXX)
$zfs list -H -t snapshot |
- grep ^
backups
/${remote_fs}@ |
- awk '{gsub(/^
backups
./,"",$1); print$1}' > $local_list
+ grep ^
${local_pool}
/${remote_fs}@ |
+ awk '{gsub(/^
${local_pool}
./,"",$1); print$1}' > $local_list
# See what the most recent snapshot on the remote end is.
latest=$(tail -n 1 $remote_list)
# See what the most recent snapshot on the remote end is.
latest=$(tail -n 1 $remote_list)
@@
-31,6
+34,6
@@
echo bogus.local >> $local_list
common=$(diff -u $remote_list $local_list | grep '^ ' | tail -n 1)
ssh $remote $zfs send -R -I${common/*@/@} $latest |
common=$(diff -u $remote_list $local_list | grep '^ ' | tail -n 1)
ssh $remote $zfs send -R -I${common/*@/@} $latest |
- $zfs receive -vF -d
backups
/${remote_fs%/*}
+ $zfs receive -vF -d
${local_pool}
/${remote_fs%/*}
rm -f $local_list $remote_list
rm -f $local_list $remote_list