rsync-time-backup icon indicating copy to clipboard operation
rsync-time-backup copied to clipboard

inprogress not set while purging old backups

Open SimonHeimberg opened this issue 4 years ago • 0 comments

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:

  1. check if inprogress exists: $(fn_find "$INPROGRESS_FILE") ... , L450
  2. expire backups: fn_expire_backups ..., L529
  3. 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.

SimonHeimberg avatar Dec 02 '19 18:12 SimonHeimberg