Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itmammoth/pysync
A simple backup/sync tool with python & rsync
https://github.com/itmammoth/pysync
python python3 rsync
Last synced: 3 months ago
JSON representation
A simple backup/sync tool with python & rsync
- Host: GitHub
- URL: https://github.com/itmammoth/pysync
- Owner: itmammoth
- License: mit
- Created: 2019-11-04T07:47:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-22T10:09:38.000Z (over 4 years ago)
- Last Synced: 2024-09-14T10:08:32.473Z (3 months ago)
- Topics: python, python3, rsync
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pysync
pysync is a simple backup/sync tool with python & rsync.
[日本語版ドキュメント](https://www.ohmyenter.com/simple-backup-tool-pysync/)
# Installation
```shell
$ pip install itm.pysync
```# Usage
Create `pysync.json` file in `~/.config/pysync.json` or `~/pysync.json`.
Here is an example of `pysync.json`.
```json5
{
// 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.
```shell
$ 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`.
```shell
$ pytest
```