Skip to content

'backup_date' does not backup if there's no previous backup and origin file timestamp is today #10

Open
@reisfe

Description

@reisfe

Issue

Function backup_date() does not create the backup under the following conditions:

  1. there's no previous backup made;
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions