-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetAllVols.sh
executable file
·41 lines (32 loc) · 996 Bytes
/
getAllVols.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
# Check if a list of journals is provided as an argument
if [ $# -eq 0 ]; then
echo "Gets all the journals listed in the fileParam from the remote server"
echo "Usage: $0 <listOfJournals>"
exit 1
fi
listOfJournals=$1
# Check if the file exists
if [ ! -f "$listOfJournals" ]; then
echo "The file $listOfJournals does not exist."
exit 1
fi
# Record the start time
startTime=$(date +%s)
# Read the file line by line and execute the command
while IFS= read -r line || [ -n "$line" ]; do
./getRemoteVol.sh "$line"
done < "$listOfJournals"
echo "=============================="
echo "== Process completed =="
echo "=============================="
# Record the end time
endTime=$(date +%s)
# Calculate the execution time
executionTime=$((endTime - startTime))
minutes=$((executionTime / 60))
hours=$((minutes / 60))
echo -e "\nExecution time:"
echo " - Seconds: ${executionTime}"
echo " - Minutes: ${minutes}"
echo " - Hours: ${hours}"