Skip to main content

Python based CLI Remote Syncing Daemon service.

Project description

RSyncDaemon

Python based CLI Remote Syncing Daemon service.

Features

  • Real time Remote syncing
  • Used secure shell session for data transfer
  • Configurable with custom config

Installation

pip install rsyncdaemon

Configuration

configuration file present at ~/.rsyncdaemon/rsyncdaemon.conf.

  • please create configuration file if not present.
  • replace values with correct values
  • remove configs that does not require

default configuration:

[SyncConfig]
local_dir = ""
remote_dir = ""
ssh_host = "localhost"
ssh_port = 22
ssh_username = "jackson"
ssh_password = ""
ssh_private_key_path = ""
rsync_command = "rsync"
rsync_options = [ "-az", "--delete",]
exclude_patterns = []

[LogConfig]
log_file_path = "/home/jackson/.rsyncdaemon/rsyncdaemon.log"
log_max_size = 10485760
log_backup_count = 5

minimum configuration:

[SyncConfig]
local_dir = ""
remote_dir = ""
ssh_host = "localhost"
ssh_port = 22
ssh_username = "jackson"
ssh_password = ""
ssh_private_key_path = ""

NOTE:

  • Remember to remove one of the option either ssh_password or ssh_private_key_path
  • configuration supports toml file type/format, i.e. it supports list/object inside config file

Usage

with Default config file

rsyncdaemon

with Custom config file

rsyncdaemon -c <config file path>
eg: rsyncdaemon -c ~/Documents/rsyncdaemon_custom_config.conf
Help
rsyncdaemon -h
Version
rsyncdaemon -v

Use as a system service

NOTE: Required sudo permission

# install Package
sudo pip install rsyncdaemon

# Create rsyncdaemon home directory somewhere. for eg /tmp/rsyncdaemon/
mkdir /tmp/rsyncdaemon/

# create config file at /tmp/rsyncdaemon/rsyncdaemon.conf inside rsyncdaemon home directory created above


[SyncConfig]
local_dir = ""
remote_dir = ""
ssh_host = "localhost"
ssh_port = 22
ssh_username = ""
ssh_password = ""
ssh_private_key_path = ""
rsync_command = "rsync"
rsync_options = [ "-az", "--delete",]
exclude_patterns = []

[LogConfig]
log_file_path = "/var/log/rsyncdaemon.log"
log_max_size = 10485760
log_backup_count = 5
# replace with correct values


# create service file at /etc/systemd/system/rsyncdaemon.service  with following content

[Unit]
Description=RSync daemon Service
After=network.target

[Service]
User=root
Group=root
ExecStart=/usr/bin/rsyncdaemon -c /tmp/rsyncdaemon/rsyncdaemon.conf
Restart=always

[Install]
WantedBy=multi-user.target

# Reloading Change to Systemd Unit Files
sudo systemctl daemon-reload

# Start service
sudo systemctl start rsyncdaemon

# Enable service to start on boot
sudo systemctl enable rsyncdaemon

# check status
sudo systemctl status rsyncdaemon

# check logs
sudo tail -f /var/log/rsyncdaemon.log

# To stop service
sudo systemctl stop rsyncdaemon

# To remove service
sudo systemctl disable rsyncdaemon
sudo rm /etc/systemd/system/rsyncdaemon.service

Uninstall

pip uninstall rsyncdaemon

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact

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

rsyncdaemon-0.0.1.tar.gz (43.2 kB view hashes)

Uploaded Source

Built Distribution

rsyncdaemon-0.0.1-py3-none-any.whl (30.7 kB view hashes)

Uploaded Python 3

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