Install and configure rsnapshot for central backup (without root privilege)

Download and install RsnapShot
Download the latest package from:

# wget
# rpm -Uvh rsnapshot-1.3.1-1.noarch.rpm

Configure public key authentication

– Enable public key authentication with remote hosts with normal user privilege

local# ssh-keygen -t rsa
local# scp

remote# useradd -c “Backup user” -d /data/home/backup/ backup
remote# su – backup

remote# vi .ssh/authorized_keys

remote# chmod 600 .ssh/authorized_keys

remote# cat >> authorized_keys ; rm

Add the command allowed to execute in the authorized_keys


Create the /home/backup/ script with following contents

    echo “Rejected 1”
    echo “Rejected 2”
    echo “Rejected 3”

$ chmod 700

Create the rsync wrapper script

$ cat  > /usr/local/bin/

/usr/bin/sudo /usr/bin/rsync “$@”;

# chmod 755 /usr/local/bin/

This steps will basically force the ssh connection to execute the rsync as sudo

Grant user to execute rsync as root

backup    ALL=(root) NOPASSWD: /usr/bin/rsync

Configure Rsnapshot

master# cp /etc/rsnapshot.conf.default /etc/rsnapshot.conf

Configure path for cp, rsync, ssh, logger, du etc

set link_dest = 1

change rsync_long_args like

rsync_long_args – –delete –numeric-ids –relative –delete-excluded

If you require daily backup for a week,

interval daily 7

More details are on the how to section for rsnapshot website

Configure the hosts and file system to backup

backup      backup@remotehost:/etc/     remotehost/






Leave a Reply

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