-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add maintenance script for removing orphaned swift segments after rcl…
…one bug
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This cleanup was necessary because rclone in version 1.54 wasn't deleting the segments correctly. The latest version of rclone fixes this problem and this is how we cleanup up the orphaned segments: | ||
|
||
source ~/swift_setup.sh | ||
swift list neurodesk_segments > neurodesk_segments.txt | ||
swift list neurodesk > legitimate_objects.txt | ||
|
||
# check if the object is in the legitimate_objects.txt | ||
while IFS= read -r line | ||
do | ||
name=$(echo $line | cut -d'/' -f1) | ||
# echo "looking for $name" | ||
if grep -q "$name" legitimate_objects.txt; then | ||
# echo "$line is a legitimate object" | ||
continue | ||
else | ||
echo "$line is an orphaned object" | ||
# swift delete neurodesk_segments $line | ||
fi | ||
done < neurodesk_segments.txt |