Using Rdist a remote file distribution utility

Dear All,

I was working on remote sychronization of pushing files to various servers normally preferred choice was to do an ssh and rsync with password less authentication but somehow came to know about rdist tool which is quite handy tool for remote sync transfer of files.

rdist requires rsh to be installed which you can do on a centos box by the command yum install -y rsh rdist

After installation is done. You have to create distfile for the remote transfer but before writing a file you have to setup password less authentication between the nodes which you want to transfer files. Following are the steps for the same :-
#ssh-keygen -t rsa -b 1024
#ssh-copy-id root@ (To transfer the keys for password less authentication)

Create a distfile for eg with following syntax :-

HOSTS = ( ldap1 root@ldap1 )

FILES = (/root/tdist/* )

(${FILES}) -> (${HOSTS})
install -R ;
${FILES} :: /root/tdist/*
notify root@ldap1;
# End of distfile file

The file commands are quite self explanatory. HOSTS refers to the remote host where the file needs to be transferred with the username.Files refer to the files to be transferred and destination. If the directory tdist is not there it would be created and all files in tdist directory would be remotely transferred. After first revision if the files are there and not updated on source host the files won’t be updated. Another advantage of rdist is that it keeps the timestamp,permissions,ownerships intact.

Now how to run the rdist command with ssh protocol.
rdist -P /usr/bin/ssh -f /rdist/distfile

You should be able to see the verbose output of the successful transfer.

Cheers. Please feel free for any queries/suggestions.

-Alok Thaker

Leave a Reply

Your email address will not be published. Required fields are marked *