diff options
author | Anand V. Avati <avati@amp.gluster.com> | 2009-04-18 11:19:34 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-18 11:42:52 +0530 |
commit | fb5cc405ae45b4e573d6acbe3383349a278f2bdf (patch) | |
tree | c3c5240db2832f2b91fbc761a48fb90484a26e25 | |
parent | 093141a74962f11654c44fe2292605f9cf65e709 (diff) |
enhancement to migrate-unify-to-distribute.sh
-rwxr-xr-x | extras/migrate-unify-to-distribute.sh | 17 |
1 files changed, 15 insertions, 2 deletions
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') |