Skip to content

PinataMostGrim/archive-files

Repository files navigation

archive-files

Command line tool for creating encrypted backup archives with configurable file exclusion patterns.

Quick Start

  1. Create config: python archive_files.py -c my-config.json
  2. Edit paths: Update target_paths and destination_folder
  3. Validate: python archive_files.py -v my-config.json
  4. Run backup: python archive_files.py my-config.json

Configuration Options

Configuration files support // comments for documentation.

Option Description Default
target_paths Array of files/folders to archive [""]
destination_folder Where to move completed archive ""
compression_folder Temporary folder for compression ""
passphrase Enables encryption (leave empty to disable) "password"
encryption_method "openssl" or "gpg" "openssl"
archive_prefix Archive filename prefix "Backup"
timestamp Add timestamp to filename true
compress_level Compression level (0-9) 9
cleanup Delete intermediate files false
follow_symlinks Include symbolic links false
ignore_patterns Array of glob patterns to exclude []

Ignore Patterns

Use glob-style patterns to exclude files and directories:

{
  "ignore_patterns": [
    "*.tmp",
    "*.log",
    "__pycache__",
    "node_modules",
    ".git",
    "Library",
    "**/build/**"
  ]
}

Pattern tips:

  • For directories: Use Library not Library/
  • Cross-platform: Patterns work with both / and \ separators
  • Wildcards: * matches files, ** matches directories recursively

Example Configurations

See included example files:

  • example-simple.json - Basic backup setup
  • example-config.json - Full-featured configuration
  • example-unity.json - Unity project with appropriate exclusions

Usage

# Create and customize config
python archive_files.py -c my-backup.json

# Validate configuration
python archive_files.py -v my-backup.json

# Run backup
python archive_files.py my-backup.json

# Decrypt archive
python archive_files.py -d encrypted-file.zip.enc my-backup.json

# Follow symlinks (override config)
python archive_files.py -f my-backup.json

# Dry run (validate config and check for conflicts)
python archive_files.py --dry-run my-backup.json

Requirements

  • Python 3
  • (Optional) OpenSSL or GPG for encryption

About

CLI that copies files and folders into an encrypted archive and optionally moves the output to a target destination

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages