Description
Issue
Function backup_date()
does not create the backup under the following conditions:
- there's no previous backup made;
- timestamp of file to be backed up is the same as the one when we try to make the backup;
Diagnostic
The issue seems to be caused by code in 'DirectoryQueue.R', function/method should_rotate()
, line 601. In case there's no backup, self$last_rotation
returns NULL and the following line of code
if (is.null(last_rotation))
return(TRUE)
seems to indicate that the intended behavior is to create backup in such case.
However, the code in line 601:
last_rotation = self$last_rotation %||% file.info(self$origin)$ctime
results that last_rotation assumes the value of the timestamp of the file to be backed up and if that date is the same of the current day then the backup is never made. The code in line 601 makes me doubt what is in fact the intended behavior under the conditions listed above.
Suggestion
In my opinion, under those conditions the backup should be made.