Skip to main content

Customisable file transfers using rsync

Project description

synchro

Customisable file transfers using rsync


About

Synchro is a simple python-based tool for customisable file movements, e.g. copying data to a backup server.

Synchro currently supports/includes:

  • Transfer via ssh
  • Archiving using tar (and option extraction)
  • Option to only transfer data when a specific file is present
  • Logging to file

To install

To install, you need a Unix-based system with Python (>3.6) installed, and then:

pip install synchro

However, it is recommended to install conda (e.g. miniconda) first and create a new environment:

conda create --name synchro python=3.9
conda activate synchro
pip install synchro

If you don't have rsync installed, you will need to do so. E.g. on macOS it can be installed with homebrew:

brew install rsync

To use

synchro has two modes of use on the command line, either with flags, or a config file.

Command line flags

Not yet implemented

Config file

The only input is the path to a source directory (the one being transferred).

synchro /path/to/source_directory

This source directory must contain a synchro.conf file which contains the information needed for the transfer. Including:

  • destination - Where to move the data to e.g. /path/to/destination_directory)
  • untar - Untar the data after copying? e.g. y
  • create_dest - Create the destination directory if it doesn't exist? e.g. y
  • transfer_ready_file - A file that must exist in the source directory (or relative path) for the transfer to initative. This option is ignored if the line is missing from synchro.conf

Example:

destination = /path/to/destination_directory
untar = y 
create_dest = y 
transfer_ready_file = ready.txt

N.B. the destination can also be on a remote host (an ssh key must be set up), e.g.:

destination = user@IP:/path/to/destination_directory

To use with cron

N.B. This assumes you've installed in a conda environment

Example - running file transfers hourly (tested on CentOS)

  • Create a text file in /etc/cron.hourly called synchro
cd /etc/cron.hourly
touch synchro
  • Add synchro commands to the text file using the full path to the synchro executable
/home/user/miniconda3/envs/synchro/bin/synchro /path/to/directory1
/home/user/miniconda3/envs/synchro/bin/synchro /path/to/directory2

This will then try to backup directory1 & directory2 every hour.

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

synchro-0.0.1rc0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

synchro-0.0.1rc0-py2.py3-none-any.whl (8.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file synchro-0.0.1rc0.tar.gz.

File metadata

  • Download URL: synchro-0.0.1rc0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for synchro-0.0.1rc0.tar.gz
Algorithm Hash digest
SHA256 dbef5baf1186a0ed86e219127c8243f96b49733140f9f35d43b016d847578e4c
MD5 c737864d06bca967b6fb4519996e2ae1
BLAKE2b-256 70d75f7729380c6d1872fed3473698b2af9e1802c75566ef944ab8bf4c66b682

See more details on using hashes here.

File details

Details for the file synchro-0.0.1rc0-py2.py3-none-any.whl.

File metadata

  • Download URL: synchro-0.0.1rc0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for synchro-0.0.1rc0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 51945d7cebdf3c25a4809c07e5bf2abb49143ac135c62b23f95e0739f508e37e
MD5 39b138f4a8024a12db4c469d7aa80094
BLAKE2b-256 d3b7b8008a1c525c18b5df7174ac1898b17504bc872c6a209305b92fac912c85

See more details on using hashes here.

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