Skip to content
Snippets Groups Projects
Commit db45b981 authored by rhatto's avatar rhatto Committed by intrigeri
Browse files

Cleanup orphaned metadata (#3727)

parent fb393b49
Branches
Tags
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment