I have found out that rsnapshot is great tool for backing up my stuffs for local file system. Now I need to do rsnapshot_push.conf file where I give params to rsync server. What is the right way to do this? Can I use rsync to /rsnapshot-backups/localhost/ syncing it to rsync server.
Rsnapshot is pull-based by design. The power of Rsnapshot lies in using hard links, and that only works for local file systems. (nfs could be used as it supports hard links, but not for instance sshfs).
In a push scenario, the best solution is to simply push to to a backup directory on the server using rsync, and then allow rsnapshot handle snapshotting from that directory, as it was designed to. Rsnapshot doesn't care if changes were introduced by an rsync or by saving a file.
In the rsnapshot FAQ there is a fancy solution that triggers rsnapshot after the rsync, but that could be overkill. Just running rsnapshot from its recular cron jobs works just as well.
An alternative solution is rdiff-backup, however this does not present a nice directory view of each snapshot and requires running commands to restore files, which may complicate fast restoring.
Another option is to use a reverse ssh tunnel and then to a "remote" pull from the receiver's side:
where
pull-from-sender-rsnapshot.conf
might contain a line like:This could be invoked by cron on the sender's side, triggering the remote rsnapshot locally.
I developed rsnappush specifically to solve same problem you're encountering, and actually came across your post because I was looking for a pre-built solution (that didn't exist yet).
SYNOPSIS
rsnappush [-h] [-r RSYNC_OPT] [-q] SOURCE_PATH [ACCOUNT:]DEST_PATH
DESCRIPTION
rsnappush is a wrapper around rsync(1) to assist in file-level incremental snapshots that are pushed to a destination. Unchanged files are hard-linked. Files are plainly laid out in a directory for each snapshot: DEST_PATH/backup-YYYYmmdd-HHMM/ for easy access and restoration.
SOURCE_PATH is any local path.
DEST_PATH is a path, local or remote. If remote, ACCOUNT specifies an ssh(1)-compatible account description, such as USER@HOST.
Additionally, under DEST_PATH there is a permissions/ directory created that has compressed output from getfacl(1). setfacl(1) can be used to restore permissions from this file once it is uncompressed.
EXAMPLE