Skip to content

--purge option should include other objects #118

@haidangwa

Description

@haidangwa

It appears that the --purge option only deletes users that are in the backup and not in the chef server being backed up. This should extend to other objects. For example, a system that has gone through modifications and several runs of knife-ec-backup could be left with json files in the backup directory that no longer exist on the chef server. In our case, several hundred chef orgs and nodes were removed from the chef server for being stale (identified by knife-tidy). The files related to these orgs and nodes still remain in our backup path. Subsequent backups will update pertinent objects, but it'll do nothing with the objects that have been removed.

I've found that it deletes most of the objects; only the entire org is not deleted. In the output, below, roles are not deleted, because I believe that no roles needed to be removed.

# grep 'Deleted extra entry' ecbackup_2018-02-18.log|awk -F\/ '{print$2}'|sort|uniq
acls
clients
cookbooks
environments
nodes

This impacts us on a restore in the future, since those objects that have already been deleted from the chef server could potentially be restored from their json files when the organization is restored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions