Post in evidenza

Recovery - Access, Excel, Word, Office and Photo recovery tools and other blog procedures

During these years I had necessity to recover various files (.doc, mdb, .xls, photos...)  I utilized various free tools (here is an exampl...

Linux - Rsync

Sincronizziamo da un server ad un altro una cartella

Esempio ⇒ copiamo da una cartella /var/www/html su un  HostA[] in  /home/backup sull'HostB[]. 

[1] Sull'host B

yum -y install rsync xinetd 

vi /etc/xinetd.d/rsync 

# default: off
# description: The rsync server is a good addition to an ftp server, as it \
#      allows crc checksumming etc.
service rsync
    disable = no # change
    flags= IPv6
    socket_type = stream
    wait= no
    user= root
    server= /usr/bin/rsync
    server_args= --daemon
    log_on_failure+= USERID

/etc/rc.d/init.d/xinetd start

Starting xinetd: [ OK ]

chkconfig xinetd on

mkdir /home/backup

vi /etc/rsyncd.conf

# any name you like
# destination directory
path = /home/backup
# Hosts you allow to copy (specify source Host)
hosts allow =
hosts deny = *
list = true
uid = root
gid = root
read only = false

[2] Sull'Host A

yum -y install rsync

vi /etc/rsync_exclude.lst # specify files or directories you'd like to exclude to copy

[3] Sull'Host di origine:

Per eseguire rsync sull'host di origine

rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /var/www/html/ # Add in cron if you'd like to run reguraly

crontab -e # run at 2:00 AM in a day

00 02 * * * rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /var/www/html/