replace rremove with rm, because rremove is not reliable

master
Marc Wäckerlin 6 years ago
parent ce401ce289
commit 04b1f1589a
  1. 6
      lizardfs/lizardfs-snapshots.sh

@ -111,7 +111,8 @@ for src in "${SOURCES[@]}"; do
echo " " "lizardfs makesnapshot -lf '${src}' '${DESTINATION}/${target}${date}'" echo " " "lizardfs makesnapshot -lf '${src}' '${DESTINATION}/${target}${date}'"
if test -n "$del"; then if test -n "$del"; then
for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do
echo " " "lizardfs rremove -l '$f'" #echo " " "lizardfs rremove -l '$f'"
echo " " "rm -rf --one-filesystem '$f'"
done done
fi fi
else else
@ -119,7 +120,8 @@ for src in "${SOURCES[@]}"; do
lizardfs makesnapshot -lf "${src}" "${DESTINATION}/${target}${date}" lizardfs makesnapshot -lf "${src}" "${DESTINATION}/${target}${date}"
if test -n "$del"; then if test -n "$del"; then
for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do
lizardfs rremove -l "$f" #lizardfs rremove -l "$f"
test -d "$f" && rm -rf --one-filesystem "$f"
done done
fi fi
fi fi

Loading…
Cancel
Save