laurent22 / rsync-time-backup

Time Machine style backup with rsync.
3.36k stars 443 forks source link

Log file name does not match snapshot name #255

Open ehoffman2 opened 1 year ago

ehoffman2 commented 1 year ago

When creating snapshot, the name is derived from current date/time.

NOW=$(date +"%Y-%m-%d-%H%M%S")
// ...
DEST="$DEST_FOLDER/$NOW"

However, the log file name is later generated from current date LOG_FILE="$LOG_DIR/$(date +"%Y-%m-%d-%H%M%S").log"

This has the effect that I end up having a snapshot directory with a different name than the log file (off by 1 second).

The log file name should be generated from the same date as the snapshot, i.e.

LOG_FILE="$LOG_DIR/$NOW.log"