View Single Post
Old 11-04-2019, 12:18 AM   #7
haertig
Wizard
haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.
 
Posts: 1,899
Karma: 31522252
Join Date: Sep 2017
Device: PW3, Fire HD8 Gen7, Moto G7, Sansa Clip v2, Ruizu X26
You didn't mention which operating system you are using (Windows, Linux, MacOS, etc.) so I'll provide you with a Linux example, since this is what I use (and I actually use the code below to copy my Calibre library between computers). If you use Windows, I'm sure somebody has ported rsync to that platform. MacOS, being very Linux/Unix-like under the hood, probably has the rsync command built in - but I'm just guessing and I don't know that for sure, because I've never used a Mac.


The commands/configuration below will copy the Calibre library
from: 192.168.0.2 /media/DigitalBooks
to: 192.168.0.3 /var/opt/calibre

On computer 192.168.0.2
===

/etc/rsyncd.conf:
Code:
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsync.log

[files]
path = /media/Digitalbooks
comment = CALIBRE EBOOKS
timeout = 600
read only = true
hosts allow = 192.168.0.3
auth users = calibre
secrets file = /etc/rsyncd.secrets
/etc/rsyncd.secrets:
Code:
calibre:my_password
Run this command:
Code:
rsync --daemon

On computer 192.168.0.3
===

Run this command:
Code:
/usr/bin/rsync -avzh --password-file=/home/calibre/bin/rsync.calibre.credentials rsync://calibre@192.168.0.2:873/files/ /var/opt/calibre/
/home/calibre/bin/rsync.calibre.credentials:
Code:
my_password

Once you have the above working to your satisfaction, you will want to run the rsync daemon automatically on 192.168.0.2 and the manual rsync command periodically on 192.168.0.3. There are many different ways to do this. Personally, I use systemd. cron/init would be simpler if you don't know systemd.
haertig is offline   Reply With Quote