This tool allows you to save and restore file metadata, inspired by metastore. It supports preserving file owner, group, permissions, modification time, and extended attributes. It can also operate on files tracked by Git.
- Save and restore file metadata including owner, group, mode, mtime, and xattrs.
- Option to operate only on files tracked by Git.
- Exclude files using regex patterns.
- Python 3.x
- pyyamllibrary
- xattrlibrary (optional for extended attributes)
Clone the repository and install the required dependencies:
git clone <repository-url>
cd <directory>
pip install -r requirements.txt
chmod +x cli.pypython3 cli.py [options] <metadata_file> [target_directory]Examples:
cli.py --mtime --git --save .metadata.yaml
cli.py --mtime --git --diff .metadata.yaml
cli.py --mtime --git --restore .metadata.yaml- --mtime: Include modification time.
- --owner: Include file owner.
- --group: Include file group.
- --mode: Include file permissions.
- --xattrs: Include extended attributes (requires xattr).
- --git: Only include files tracked by Git (requires /usr/bin/git).
- --exclude <regex>: Exclude files by name using regex.
- --save: Save current metadata state.
- --restore: Apply saved metadata state.
- --diff: Show what restore would change.
This project is licensed under the MIT License. See the LICENSE file for details.