Add --hard-links to rsync options
[mirror/dsa-puppet.git] / modules / roles / files / static-mirroring / static-master-update-component
index 2f1742b..6f7ff03 100755 (executable)
@@ -85,8 +85,8 @@ if [ -z "$srchost" ] || [ -z "$srcdir" ]; then
 fi
 tgt="$base/$component"
 if ! [ -d "$tgt" ]; then
-  echo >&2 "$0: Invalid component: $component ($tgt does not exist)";
-  exit 1
+  echo "$0: Creating $tgt for $component";
+  mkdir "$tgt"
 fi
 
 if [ "$srchost" = "`hostname -f`" ]; then
@@ -109,7 +109,8 @@ echo "$0: Got them."
 
 echo "$0: Updating master copy of $component..."
 rsync --delete \
-  -tr \
+  -trz \
+  --links --hard-links --safe-links \
   --link-dest="$tgt" \
   "$src/." "$tmpdir_new/."
 echo "$0: Done.  Committing."