rsync Mirroring

http://www.howtoforge.com/mirroring_with_rsync

Source Server Configuration
Create an unprivileged user that can access the files you want and give that user a password:

useradd -d /home/mirror -m -s /bin/bash mirror
passwd mirror

Switch to that user and go the home directory:

su mirror
cd ~

Create a few test files:

touch test.txt help.txt mirror.txt

Destination server
Test rsync the connection to the remote server:

rsync -avz --delete -e ssh mirror@<SOURCE SERVER ADDRESS>:/home/mirror /tmp/mirror/

If your SSH is listening on a different port:

rsync -avz --delete -e "ssh -p <portnumber>" mirror@<SOURCE SERVER ADDRESS>:/home/mirror /tmp/mirror/

Options

  • --delete - Deletes files on the destination that don't exist on the source
  • --exclude=<files to exclude> - don't synch the specified file(s)
  • --no-links - skip symbolic links
  • -C - ignore CVS files (.svn, etc)

Using public key authentication will eliminate the need for entering a password, allowing you to automate the rsync using cron.

Technology:

Recent Updates

  • 11 months 1 week ago
    1.27.2 update
  • 11 months 3 weeks ago
    Drupal 10/11 config
  • 11 months 3 weeks ago
  • PHP
    11 months 3 weeks ago
    PHP 8.3.11 and AlmaLinux
  • 11 months 3 weeks ago
    New version of Pound
Error | Production Monkeys

Error

The website encountered an unexpected error. Please try again later.