Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup service supports conditional filtering of key data #264

Open
Tracked by #268
lurenpluto opened this issue May 12, 2023 Discussed in #263 · 2 comments
Open
Tracked by #268

Backup service supports conditional filtering of key data #264

lurenpluto opened this issue May 12, 2023 Discussed in #263 · 2 comments
Assignees
Labels
Backup & Restore The OOD backup and restore related Tools CYFS related tools User-friendliness To improve the usability of the interface & SDK

Comments

@lurenpluto
Copy link
Member

Discussed in #263

Originally posted by wugren May 12, 2023
Sometimes, some configuration directories do not need to be backed up, and it is hoped that they can be excluded through parameters.

@lurenpluto lurenpluto added User-friendliness To improve the usability of the interface & SDK Backup & Restore The OOD backup and restore related labels May 12, 2023
@lurenpluto
Copy link
Member Author

The current uni backup mechanism uses a built-in dir and file list in the process of backing up key data, the filter needs to be expanded on this list, and for directories, each internal subdirectory and file in the backup, the filter also needs to be applied to ensure that the granularity of the file can be processed correctly

In terms of usage, consider adding a key data filter list to backup params, which specifies the directories and files to be filtered. In order to provide broader support, consider supporting the glob paradigm for the filter list, so that users will have more freedom when editing the filters.

@lurenpluto lurenpluto self-assigned this May 12, 2023
@lurenpluto lurenpluto added the Tools CYFS related tools label May 12, 2023
lurenpluto added a commit that referenced this issue May 13, 2023
…pports-conditional-filtering-of-key-data' into main
@lurenpluto
Copy link
Member Author

The following improvements and support have been added

  1. uni backup of cyfs-backup supports filter
    The key_data_filters parameter has been added to specify a set of key data file paths to be filtered, support glob pattern, and support filtering files and directories.

#[derive(Debug, Clone, Serialize, Deserialize,)]
pub struct UniBackupParams {
pub id: String,
pub isolate: String,
pub password: Option<ProtectedPassword>,
pub target_file: LocalFileBackupParam,
// Key data filters in glob format
pub key_data_filters: Vec<String>,
}

  1. cyfs-backuo-tool's restore function supports --key-data-filter parameter
    Support passing multiple parameters, that is, you can specify multiple file paths to be filtered, such as
. /cyfs-backup --mode backup --id test --key-data-filter /cyfs/etc/gateway/** --key-data-filter /cyfs/etc/ood-daemon/**

The above backup command filters the configuration directories of ood-daemon and gateway under /cyfs/etc. The configuration and directories of other services are not affected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backup & Restore The OOD backup and restore related Tools CYFS related tools User-friendliness To improve the usability of the interface & SDK
Projects
Status: 🧪To Test
Development

No branches or pull requests

1 participant