Skip to main content

rzn - rsync/rclone git like push/pull wrapper

Project description

Introduction

I created rzn because I'm used to running git push / pull for synchronizing my files. But for some use cases, like synchronizing my pictures / music etc, git would be an overkill in used storage and speed.

Rzn leverages rsync or rclone to synchronize your files. It searches for the configuration file .rzn in the current or parent directories like git so you can run rzn push / pull from any (sub)directory.

Install

$ pip install git+https://github.com/meeuw/rzn

or download rzn.py and place it in your path.

Usage

You can use the --backup argument of rsync / rclone to make sure rzn never overrides / deletes your files. You're free to use any directory but I use the following directory structure (local and remote):

$ find bluh
bluh/current/file1
bluh/current/dir1/file1
bluh/2019-03-03T07:31:09.015242/dir1/file1
bluh/2019-03-04T09:10:08.023142/file2

As rzn doesn't do any versioning you'll have to be really cautious with cleaning your backups. As rsync also synchronizes your timestamps a tool like fdupes might be usefull to cleanup duplicate files. Before removing changed files I'd recommend to always compare the current and backupped files.

You can use sparsefilters to generate --filter arguments for rsync for sparse synchronisation. Sparse filters make it possible to only synchronize specific files / directories with a remote location.

The only required configuation item in the [main] section is remote. The local location of the synchronisation arguments is determined by the location of your .rzn file.

Sample .rzn file:

[main]
remote = /home/meeuw/tmp/remote
append = /current/
sparsefilters =
   /bluh
   /dir***
args = -Pa
  --backup
  --backup-dir={target}../{datetimeisoformat}
  --delete
  --delete-excluded

I recommend to always run rzn pull before making any changes to your files and rzn push as soon as possible.

$ rzn pull

$ vi file1

$ rzn push

FAQ

Q: Why isn't the file which I've pushed shared anymore?

A: When using rclone you might not want to use a remote backup directory if your files are shared with other users, if you push changes to an existing file it will be replaced and your shared file will be moved to the backup directory. As (most) cloud remotes have their own versioning / recycle bin you don't need a backup dir. You can use the configuration item pull_args to use the --backup-dir argument only for your local files.

Q: Why should I use this tool instead of using automatic synchronisation?

A: Rzn gives you full control about when and how your files are synchronized.

Q: I've found a bug or limitation of rzn

A: Use the issue tracker (on GitHub) to report your issue and if you can, fix it yourself and submit a pull request.

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

rzn-0.4.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rzn-0.4.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file rzn-0.4.0.tar.gz.

File metadata

  • Download URL: rzn-0.4.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.8 Linux/6.0.11-300.fc37.x86_64

File hashes

Hashes for rzn-0.4.0.tar.gz
Algorithm Hash digest
SHA256 284b6a1d56df6b77d6a176269be2d0382dccf372856fbec0c7ec2d2348629fcd
MD5 f557b21342df838e10a2cdb0a59240cf
BLAKE2b-256 792a469e5716459aaf989719c8d4cb0722634b069edfef13058d4b201c914a10

See more details on using hashes here.

File details

Details for the file rzn-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: rzn-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.8 Linux/6.0.11-300.fc37.x86_64

File hashes

Hashes for rzn-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a30de3a2e5444bc0cf45a4be243a793267f5001404f67be61f00bdfe50ef567
MD5 814253e24a5afd7f60e64afeef29f5fd
BLAKE2b-256 e6ee6b165ea2435e42414922b16a6b684b2c1178fc582b7f7474e0c1397e75e2

See more details on using hashes here.

Supported by

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