Skip to main content

A simple backup/sync tool with rsync

Project description

pysync

pysync is a simple backup/sync tool with python & rsync.

日本語版ドキュメント

Installation

$ pip install itm.pysync

Usage

Create pysync.json file in ~/.config/pysync.json or ~/pysync.json.

Here is an example of pysync.json.

{
    // Set rsync options (default: -a -v -h)
    "rsync_options": ["-a", "-v", "-h", "--delete", "--iconv=UTF-8-MAC,UTF-8"],

    // Define rsync filters
    "filters": {
        "git": ["-C", "--filter", ":- .gitignore"]
    },

    // Set global exclusions to exclude files and directories in all backup sources
    "global_exclusions": [".DS_Store"],

    // Set destination directory path
    "destination": "/Volumes/HDD/backup",

    // Set backup sources
    "sources": [
        {
            "path": "/Users/whoami/Documents"
        },
        {
            "path": "/Users/whoami/Pictures",
            "exclusions": ["*.photoslibrary", "secrets/"]    // Specify exclusion patterns to exclude in the source
        },
        {
            "path": "/Users/whoami/Programs",
            "filter": "git"     // Use filter in the source
        }
    ]
}

Run pysync.

$ pysync

Command Line Options

Option Feature
-c, --config-file Indicate config file path (e.x. pysync -c ~/hoge/pysync.json)
-h, --help Show help
--version Show version

License

MIT License

Testing

Test with pytest.

$ pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itm.pysync-1.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

itm.pysync-1.0.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page