A Python-based tool for real-time file monitoring and synchronization, designed to replicate changes between local or remote locations.
Project description
WatchSync
WatchSync is a tool for synchronizing files when they are created or modified across different storage locations. A file can also be a local directory that, when detected as modified or created, is synchronized with the configured storage locations. A storage location can be a local or remote directory where a copy of the files will be sent.
The purpose of this tool is to have a backup of files in different storage locations to avoid losing important information. It is a file replication solution that is very easy to configure and use.
Features
- Automatic synchronization of files and directories.
- Support for multiple local and remote storage locations.
- Easy to configure and use.
- Uses
rsyncfor efficient file synchronization.
Installation
Requirements
WatchSync uses rsync for file synchronization, so it must be installed on the system. On Debian-based systems, it can be installed with the following command:
sudo apt install rsync
As a package
Install the package with pip:
pip install watchsync
From source code
Clone the repository:
git clone https://github.com/rlizana/watchsync.git
cd watchsync
Install dependencies and build the package:
poetry install
Install the package globally:
poetry build
pip install dist/watchsync-*.whl
Usage
WatchSync uses a daemon to monitor file changes and synchronize them with storage locations. A storage location can be a local directory, a remote server, or a git repository.
To start the daemon, use watchsync start, and to stop it, use watchsync stop. If you want to restart the daemon to reread configuration changes, use watchsync reload.
Storage Locations
To manage storage locations, use the command watchsync store.
You can list storage locations with watchsync store list, add a storage location with watchsync store add NAME TYPE PATH, and remove one with watchsync store del NAME.
Alternatively, you can edit the configuration file ~/.config/watchsync/config.yaml to add storage locations manually, but note that the daemon will not pick up changes until you restart it after making modifications.
Files
To manage the files being monitored, use the command watchsync file.
You can list files with watchsync file list, add a file with watchsync file add PATH, and remove a file with watchsync file del PATH.
Development
This project is developed using TDD. Therefore, any changes or improvements to be added must first include a failing unit test, and then the necessary code must be written to make the test pass.
Install the development dependencies:
poetry install --with dev
poetry run pre-commit install
To run unit tests:
poetry run python3 -m unittest discover -s tests
With coverage:
poetry run coverage run -m unittest discover -s tests
poetry run coverage report
Or you can run the command
poetry run watchsync
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file watchsync-0.1.0.tar.gz.
File metadata
- Download URL: watchsync-0.1.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.0-13-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e717e589ae6123a42b8399a995c41a352bec606ca7ce5b5622d666403fe70f1
|
|
| MD5 |
31d74b4cb2a7a2ef4c8f7a1ef4c7fdf9
|
|
| BLAKE2b-256 |
27ce2c096915d4ff5eeebea5a2b5b6baa943477519b58add0f5145b56124ae88
|
File details
Details for the file watchsync-0.1.0-py3-none-any.whl.
File metadata
- Download URL: watchsync-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.0-13-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31db33c9784c1b95fcf8493592f6506306a3e791fa4128c5b6ff4598545ee6b7
|
|
| MD5 |
a2582a627b21a8444f5e5e0bbeb234e3
|
|
| BLAKE2b-256 |
cc8b95a04a5ddb770fddac4acb0c92589b22037c84c4c4996d43c293561fbc01
|