Janux — Blog

May 9, 2007

How to Rsync automatically

Filed under: Gnu/Linux — janux @ 9:46 pm

First… need to define one box like server and other box like client… lets play !

== SERVER-SIDE ==

I .- Edit /etc/xinetd.d/rsync —> Must be like this:
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

II .- Edit / Create this file /etc/rsyncd.secrets

remote_user:SOMEPASSSWORD

III .- Edit / Create this file /etc/rsyncd.conf
uid = nobody
gid = nobody
use chroot = yes
max connections = 2
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid

[backup1]
path = /home/janux/BackUpMay2007/
comment = JanuxBackUP4May2007
use chroot = true
max connections = 2
read only = false
list = false
auth users = remote_user
secrets file = /etc/rsyncd.secrets
strict modes = false
uid = SOMEUSER
gid = SOMEUSER

** SOMEUSER & SOMEPASSWORD MUST be CHANGED !!!

== CLIENT-SIDE ==
I .- Create a file called: RSYNC_PASSWORD.txt and put it in some directory ( / )
SERVERPASSWORD

II .- Create a Bash file to synchronize the files ( /usr/bin/RsyncMay2007Data.sh )
#!/bin/bash
cd ~janux/
rsync -acvz --password-file=/RSYNC_PASSWORD.txt --progress * rsync://remote_user@SERVER_IP:873:./backup1

** Be sure you have access to port 873 ( rsync port )
[ratings]

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress