Cleanup orphaned metadata (#3727)

This commit is contained in:
Silvio Rhatto 2012-01-03 18:54:58 -02:00 committed by intrigeri
parent fb393b49c5
commit db45b98132

View File

@ -317,6 +317,14 @@ function rotate_short {
$nice $cp -alf /$folder.1/. /$folder.0
fi
# Cleanup orphaned metadata
for file in `ls $metadata`; do
if [ ! -d "`dirname $folder`/$file" ]; then
debug "removing orphaned metadata $file"
rm -rf $metadata/$file
fi
done
}
function rotate_short_remote {
@ -355,6 +363,14 @@ function rotate_short_remote {
if [ -d $folder.1 ]; then
$nice $cp -alf /$folder.1/. /$folder.0
fi
# Cleanup orphaned metadata
for file in `ls $metadata`; do
if [ ! -d "`dirname $folder`/\$file" ]; then
debug "removing orphaned metadata \$file"
rm -rf $metadata/\$file
fi
done
##### END REMOTE SCRIPT #######
EOF
) | (while read a; do passthru $a; done)
@ -466,6 +482,14 @@ function rotate_long {
done
done
# Cleanup orphaned metadata
for file in `ls $backuproot/metadata`; do
if [ ! -d "$backuproot/$file" ]; then
debug "removing orphaned metadata $file"
rm -rf $backuproot/metadata/$file
fi
done
}
function rotate_long_remote {
@ -575,6 +599,14 @@ function rotate_long_remote {
fi
done
done
# Cleanup orphaned metadata
for file in `ls $backuproot/metadata`; do
if [ ! -d "$backuproot/\$file" ]; then
debug "removing orphaned metadata \$file"
rm -rf $backuproot/metadata/\$file
fi
done
##### END REMOTE SCRIPT #######
EOF
) | (while read a; do passthru $a; done)