Skip to main content

orite

An opinionated rsync wrapper written in Python

The purpose of orite is to synchronise folders and files between a remote and local server.

FTP apps like Transmit and Cyberduck can synchronise content, but they are slow.

The CLI tool rsync is brilliant for this purpose in that it is lightning quick. The problem is that there is a lot to type in. There are a lot of flags to remember, as well as the username, IP address, the remote path, and the exclude file path. I also find it hard to remember to include a slash on the local and exclude a slash on the remote path. Meaning one can copy the entire repo into the wrong folder or just loose amongst your other stuff.

I used to do this thing using Git and a Python library called fabric. Running the fabfile would commit, push, login to the remote server and then pull and restart. Whilst it was accurate it was a little clunky and again not super fast. I moved on from that to running a straight shell script. I ended up with variations of this script in each folder I made.

This project is an effort to centralise a sync approach, add options, future functionality, and do it using Python.

ōrite is a Māori word for ʻthe same’

It's pronounced like this rather than ‘oh-right’.


Installation

I'm working on

pip install orite

In the meantime download the orite.py file and add an alias to your bash profile.

alias orite='python3 path-to-orite-folder/orite.py'

You will also need to download the _orite_exclude.txt and put it in the same location as orite.py.

How to run?

Run the following command preferably above the folder you are looking to copy.

orite -i

Will initialise two configuration files

orite -^ 

Will upload

orite -v

Will download. By default, orite will run in dry-run mode. Use the -r flag to override this.


Improvements

  • Change the settings.py file into a _orite_config.ini file. This will facilitate writing to config whilst running the app.

  • How does this directory differ from the remote one? Whilst we can run rsync with the dry run flag the feedback you get is unsatisfactory. rsync will tell you that files differ, but if you want to know exactly what the difference is, which lines, for example, you are out of luck.

    diff is great with this kind of thing, but getting diff to run over a network is slow.

    1. So the suggested solution is to make an invisible copy of the local folder to _orite_copy__<folder_name>
    2. Sync from the remote folder to the copy
    3. run diff -r -N <folder_name> _orite_copy__<folder_name>/ --exclude-from <path-to>/_orite_exclude.txt

    Potentially format the output so that it has a better hierarchy and is clearer. From here one could manually copy across the bits they want or possibly do it programmatically. Like:

    $ These are the file/folder/s that differ \1. filename \2. filename \3. whole_folder_name \4. all Which remote file/folder/s would you like to copy to your local folder? i.e 1 or [2, 3]

  • Enable the config file to have multiple servers. For example, I use one server to run Django and a different one for Nginx. I don't want two sets of config and exclude files. I won't be able to do: orite -^ which will upload to the default server and orite -^ css to the CSS one.

  • Investigate a safe mode? --backup flag and the scary delete after flag.

  • The --info=flist flag only works in rysnc that is >= 3.1 Think about how to implement it so that older versions work too.

  • Maybe there should be a rsync command flags option in the default config file. If it exists then the default command is overwritten.

  • If it there is trouble connecting orite could look for an RSA key. If it exists then copy it to the server. If it doesn't then make one and copy it to the server.

Release files for orite 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orite 0.0.8
File Size Uploaded
orite-0.0.8.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for orite 0.0.8
File Interpreter ABI Platform
orite-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / orite-0.0.8.tar.gz

Download URL orite-0.0.8.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
36fedb354f2a23000ecef6a56be8b69a79a4ce017396a8aafd1b839fb1eaf808
BLAKE2b-256 checksum
How to use checksums
cf9092c9161277ec23a1fa19db5e503e3ec9062082d003b527c2679f56c3ea90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / orite-0.0.8-py3-none-any.whl

Download URL orite-0.0.8-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9616fa6f5e678aaf453797b78eb4e534fc7e8d6e501bf5092a20c367325b43e3
BLAKE2b-256 checksum
How to use checksums
7ccb435deff0c0adc237c8fd7134d71f2c0afba612c5b3e55c3b5a07418318e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page