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 fromsynchro.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
calledsynchro
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file synchro-0.0.1.tar.gz
.
File metadata
- Download URL: synchro-0.0.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b70ab622dab56d0324cabe1e95c993cea9f19abc6d07da2a52d2eb21c0a8c7d6 |
|
MD5 | 0a6017f3608f91ce4ce59d267ab8546d |
|
BLAKE2b-256 | 1db73d4742a933d351f80bb3488b9923ed73cb85efad6735bae1b946def52103 |
File details
Details for the file synchro-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: synchro-0.0.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3daa8d01cb1c6361e398a7078b89707a3d6614238c099f7df51a094d19f22026 |
|
MD5 | caadc1a70b40c987fa124b84eb4e83b5 |
|
BLAKE2b-256 | 140484bedae989a37c2a13d44a21e4f1c8ce7ebb19e6530e52951c86d9b2a05b |