-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcleanup.sh
37 lines (31 loc) · 895 Bytes
/
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
#!/bin/bash
set -e
# Perform cleanup
while getopts p:v: flag
do
case "${flag}" in
p) path=${OPTARG};;
v) version=${OPTARG};;
*)
echo "Invalid flag";
exit 1;
;;
esac
done
echo "Starting Cleanup ================================================================================================="
#echo "Deleting locationA"
#locationA="$path/source"
#rm -rf $locationA
echo "Deleting locationB"
locationB=$( tail -n 1 locationB$version.csv )
go run containers_handler.go "delLocB" "$locationB"
echo "Deleting locationC"
locationC=$( tail -n 1 locationC$version.csv )
go run containers_handler.go "delLocC" "$locationC"
echo "Deleting locationD"
locationD="$path/destination"
rm -rf $locationD
## Deleting AzCopy Binaries
#rm -rf azcopy_binaries
# Deleting all the CSV files created during the process
rm location*.csv