From fb5cc405ae45b4e573d6acbe3383349a278f2bdf Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Sat, 18 Apr 2009 11:19:34 +0530 Subject: enhancement to migrate-unify-to-distribute.sh --- extras/migrate-unify-to-distribute.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'extras') diff --git a/extras/migrate-unify-to-distribute.sh b/extras/migrate-unify-to-distribute.sh index fd23a46fec1..ae0c344c975 100755 --- a/extras/migrate-unify-to-distribute.sh +++ b/extras/migrate-unify-to-distribute.sh @@ -15,9 +15,22 @@ # This is export from old 'cluster/unify' volume's namespace volume. namespace_export=/exports/export-ns +namespace_host=localhost # This is the new mount point with 'cluster/distribute' volume distribute_mount=/mnt/glusterfs -cd ${namespace_export}; -find . -exec stat ${distribute_mount}/{} \; +function execute_on() +{ + local node="$1" + local cmd="$2" + + if [ "$node" = "localhost" ]; then + $cmd + else + ssh "$node" sh -c "$cmd" + fi +} + +execute_on $namespace_host "cd ${namespace_export} && find ." | +(cd ${distribute_mount} && xargs -d '\n' stat -c '%n') -- cgit