Installing and Running Rsync

Starting rsyncd automatically

  • You should build and install xinetd as detailed here, in my other post so that rsync only runs when needed. This helps minimise the loading on your server.
  • Add rsync’s daemon to the list of valid services by adding the following line at the end of /etc/services
    rsyncd 8730/tcp
  • Add rsync to your xinetd configuration
    • ## rsyncd can't run on 873/tcp because WestHost's
      ## own backup tools are running on that port.

      service my-rsyncd
      disable = no
      type = UNLISTED
      port = 8730
      socket_type = stream
      wait = no
      user = myusername
      server = /usr/mylocal/bin/rsync
      server_args = --daemon
      log_on_failure += USERID
  • The crude way
    • Edit the start up file pico /etc/rc.d/rc2.d/S60rsync to contain

      /usr/mylocal/bin/rsync –daemon

    • Edit the file shutdown file pico /etc/rc.d/rc2.d/K60rsync to contain

      for pid in $( ps auxww | grep “rsync” | grep -v grep | cut -c10-14 );
      kill -9 $pid;

Scheduling Periodic Synchronisation

  • Create a batch file using Notepad with the desired command line in it. Remember to put quotes around the filename (“rsyncd.bat”) so that it is saved with the correct extension
  • Click on the Start button of your PC
  • Click on Control Panel
  • If you are using the Category View, then click on Performance and Maintenance
  • Click on Scheduled Tasks
  • Click on Add Scheduled Task