cmdctl / py-fsync

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

py-fsync

Python client and server for file sync across multiple machines

Requirements

Ptyhon 3.6 or later

Installation

Create virtual environment:

python3 -m venv venv

Activate the virtual environment:

source venv/bin/activate

Install the requirements:

pip install -r requirements.txt

Building the client:

The client is built with the install.sh script. You will needpyinstaller installed.

cmod +x install.sh
./install.sh

This will create a dist directory with the client executable. Add the executable to your PATH.

export PATH=$PATH:$PWD/dist

Client Usage

The client takes a directory and a server address to sync with.

watcher ./data http://localhost:8000

The above command will watch the directory ./data for created files and upload them to the server.

Running the server:

Run the server with the uvicorn command.

uvicorn server:app

This will start the server on port 8000.

[OPTIONAL] - You can be notified when a file is uploaded to the server by email.

To enable email notifications add the following environment variables to your shell:

export GMAIL_USER='<your_gmail_user>'
export GMAIL_PASSWORD='<your_gmail_password>'

It will use those to connect to your gmail account and send an email when a file is uploaded.

Read more about it in this article

About


Languages

Language:Python 77.8%Language:HTML 20.6%Language:Shell 1.5%