Log file output only contains time. If logfile is appendes then there is no way of knowing then previous clones were made. If logfile is over-written then creation of the file tells when clone was made.
However, by appending date to start_time and stop_time, that only are used in the logfile output, the date can be logged too. The duration is still calculated correctly as it uses other variables. The solution is it add %F to date command.
Before:
start_time=date '+%H:%M:%S' (in 2 places)
stop_time=date '+%H:%M:%S'
After:
start_time=date '+%F %H:%M:%S' (in 2 places)
stop_time=date '+%F %H:%M:%S'
Result in logfile:
" Start - 2024-02-19 11:00:37 End - 2024-02-19 11:03:38 Elapsed Time - 3:01"
Log file output only contains time. If logfile is appendes then there is no way of knowing then previous clones were made. If logfile is over-written then creation of the file tells when clone was made.
However, by appending date to start_time and stop_time, that only are used in the logfile output, the date can be logged too. The duration is still calculated correctly as it uses other variables. The solution is it add %F to date command.
Before: start_time=
date '+%H:%M:%S'
(in 2 places) stop_time=date '+%H:%M:%S'
After: start_time=
date '+%F %H:%M:%S'
(in 2 places) stop_time=date '+%F %H:%M:%S'
Result in logfile: " Start - 2024-02-19 11:00:37 End - 2024-02-19 11:03:38 Elapsed Time - 3:01"