sync$\color[rgb]{0,0.67,0.2} 2$folders
This is a simple program that synchronizes two folders: source and replica. The program maintains a full, identical copy of source folder at replica folder. The program is written in Python.
The program is designed to be run from the command line. It takes four arguments: source folder path, replica folder path, synchronization interval and logs path. The program synchronizes the folders every time the interval expires. The program logs file creation/copying/removal operations to a file and to the console output.
Features
- Synchronization is one-way: after the synchronization content of the replica folder is modified to exactly match content of the source folder;
- Synchronization is performed periodically;
- File creation/copying/removal operations are logged to a file and to the console output;
- Folder paths, synchronization interval and log file path are provided using the command line arguments;
Quick Start
Get The Script From Git Hub Repo
Inside a folder of your choice, clone the repository from command line:
git clone https://github.com/ivanSantos16/sync2folders
You can run the program from the command line and ask for help with the script variables:
python sync2folders -h
usage: synchronisation.py [-h] -s SOURCE -r REPLICA -p PERIOD -l LOGS
Synchronizes two folders: source and replica
options:
-h, --help show this help message and exit
-s SOURCE, --source SOURCE
Source folder path
-r REPLICA, --replica REPLICA
Replica folder path
-p PERIOD, --period PERIOD
Period of time in seconds between each synchronization
-l LOGS, --logs LOGS Logs file path
Arguments Description
source: Source folder path (required) [string]replica: Replica folder path (required) [string]period: Period of time in seconds between each synchronization (required) [int]logs: Logs file path (required) [string]
Different examples of running the program.
First example:
python sync2folders -s <source_folder_path> -r <replica_folder_path> -p <sync_interval> -l <log_file_path>
python sync2folders -s source -r replica -p 10 -l logs/logs.txt
Second example:
python sync2folders --source <source_folder_path> --replica <replica_folder_path> --period <sync_interval> --logs <log_file_path>
python sync2folders --source source --replica replica --period 10 --logs logs/logs.txt
Get The Script From Pypi
From command line, install the package with pip:
python -m pip install sync2folders
From anywhere, you can run the program from the command line and ask for help with the script variables:
python -m sync2folders -h
usage: synchronisation.py [-h] -s SOURCE -r REPLICA -p PERIOD -l LOGS
Synchronizes two folders: source and replica
options:
-h, --help show this help message and exit
-s SOURCE, --source SOURCE
Source folder path
-r REPLICA, --replica REPLICA
Replica folder path
-p PERIOD, --period PERIOD
Period of time in seconds between each synchronization
-l LOGS, --logs LOGS Logs file path
Arguments Description
source: Source folder path (required) [string]replica: Replica folder path (required) [string]period: Period of time in seconds between each synchronization (required) [int]logs: Logs file path (required) [string]
Different examples of running the program.
First example:
python -m sync2folders -s <source_folder_path> -r <replica_folder_path> -p <sync_interval> -l <log_file_path>
python -m sync2folders -s source -r replica -p 10 -l logs/logs.txt
Second example:
python -m sync2folders --source <source_folder_path> --replica <replica_folder_path> --period <sync_interval> --logs <log_file_path>
python -m sync2folders --source source --replica replica --period 10 --logs logs/logs.txt
Metadata
Release files for sync2folders 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sync2folders-1.0.2.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sync2folders-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / sync2folders-1.0.2.tar.gz
| Download URL | sync2folders-1.0.2.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf5a8d91b776433b17c151fb86b43c44bbbbc6f8e3b72c4530de87dbbecc90db
|
|
BLAKE2b-256 checksum How to use checksums |
8646080bdce4d496c2f413dd510ee22ecb960896b31b63ed133e3a1fff6f86b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.10.7 Windows/10
|
Release files / sync2folders-1.0.2-py3-none-any.whl
| Download URL | sync2folders-1.0.2-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a085af87fd6f549e9682ff7042637e87b7aad076bd83ac7c4ad0c6571294742f
|
|
BLAKE2b-256 checksum How to use checksums |
30ee80393e3411579b1e2fb8e9fcd62cda85c5a29f698e7a2297ff818fbad08c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.10.7 Windows/10
|