File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
share/github-backup-utils Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ cleanup () {
118
118
119
119
rm -rf " $failures_file "
120
120
rm -f " ${GHE_DATA_DIR} /in-progress-backup"
121
+ rm -rf /tmp/backup-utils-progress/*
121
122
122
123
# Cleanup SSH multiplexing
123
124
ghe-ssh --clean
Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ cleanup () {
139
139
log_error " Failed to remove in-progress file" 1>&3
140
140
fi
141
141
142
+ # Remove progress files
143
+ rm -rf /tmp/backup-utils-progress/*
144
+
142
145
bm_end " $( basename $0 ) "
143
146
}
144
147
Original file line number Diff line number Diff line change 2
2
# / track-progress: track progress of backup or restore tasks
3
3
4
4
progress (){
5
-
5
+ # # Those progress files should be created by init_progress function
6
+ # # If they are not present (e.g., individual script is being invoked directly),
7
+ # # we will not track progress
8
+ if [ -f " /tmp/backup-utils-progress/progress" ] &&
9
+ [ -f " /tmp/backup-utils-progress/total" ] &&
10
+ [ -f " /tmp/backup-utils-progress/type" ]; then
6
11
PROGRESS=$( cat /tmp/backup-utils-progress/progress)
7
12
PROGRESS_TOTAL=$( cat /tmp/backup-utils-progress/total)
8
13
PROGRESS_TYPE=$( cat /tmp/backup-utils-progress/type)
9
14
PROGRESS_PERCENT=$( echo " scale = 2; ($PROGRESS / $PROGRESS_TOTAL ) * 100" | bc)
10
15
echo $(( PROGRESS + 1 )) > /tmp/backup-utils-progress/progress
11
16
echo " ${PROGRESS_TYPE} progress: $PROGRESS_PERCENT % ($PROGRESS / $PROGRESS_TOTAL ) $1 " > /tmp/backup-utils-progress/info
17
+ fi
12
18
}
You can’t perform that action at this time.
0 commit comments