rsync-time-backup
rsync-time-backup copied to clipboard
inprogress not set while purging old backups
The "inprogress" mark is set after purging old backups. Problem: When deleting old backups takes long (many backups to purge, slow fs because remote mount, ...), a new backup can start successfully while the 1st is still purging backups.
suggestion: create "inprogress" just after checking if it exists. This may have side effect on trying to resume an aborted backup. to improve this, the backup could get a temporary name ("_" preppended?) and be renamed to the final name when finished.
see in code:
- check if inprogress exists: $(fn_find "$INPROGRESS_FILE") ... , L450
- expire backups: fn_expire_backups ..., L529
- create inprogress file: echo $MYPID > $INPROGRESS_FILE , L566
note: also order related: defining link dest before purging backups #162 side note: DEST="$DEST_FOLDER/$NOW" is already done before purging, so the stamp in the folder name may have almost noting to do with the time of its content.