-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcleanup.sh
41 lines (36 loc) · 1.13 KB
/
cleanup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# CLEANUP.sh
# User must create $CFGFILE proir to running this script
# See "s3cmd --configure -c s3test.cfg"
CFGFILE=./s3test.cfg
# make sure S3 cfg file exists
[ -f "$CFGFILE" ] && echo "continuing" || echo "$CFGFILE does not exist."; exit
# Empty and Remove the buckets
s3cmd rb s3://mycontainers1 -c s3test.cfg --recursive || {
echo "Error removing s3://mycontainers1, exit"
exit 1
}
s3cmd rb s3://mycontainers2 -c s3test.cfg --recursive || {
echo "Error removing s3://mycontainers2, exit"
exit 1
}
s3cmd rb s3://mycontainers3 -c s3test.cfg --recursive || {
echo "Error removing s3://mycontainers3, exit"
exit 1
}
s3cmd rb s3://mycontainers4 -c s3test.cfg --recursive || {
echo "Error removing s3://mycontainers4, exit"
exit 1
}
s3cmd rb s3://mycontainers5 -c s3test.cfg --recursive || {
echo "Error removing s3://mycontainers5, exit"
exit 1
}
# Process GCs
radosgw-admin gc process --include-all &
radosgw-admin gc process --include-all &
radosgw-admin gc process --include-all &
# Wait for all GCs to be processed, none PENDING
Utils/completedGC.sh 5m /tmp/hold
# cleanup
rm -f /tmp/hold