Skip to content

axel-angel/metadata_tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Metadata Preservation Tool

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.

Features

  • 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.

Requirements

  • Python 3.x
  • pyyaml library
  • xattr library (optional for extended attributes)

Installation

Clone the repository and install the required dependencies:

git clone <repository-url>
cd <directory>
pip install -r requirements.txt
chmod +x cli.py

Usage

python3 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

Options

  • --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.

Commands

  • --save: Save current metadata state.
  • --restore: Apply saved metadata state.
  • --diff: Show what restore would change.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

save and restore file metadata: mtime, owner, permissions, ACL (made in Python)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages