Rsync to backup data from one server TO Freenas

Status
Not open for further replies.

roby84

Dabbler
Joined
Jun 17, 2012
Messages
11
Hi,
I would like to backup all the data from one server (Linux Centos 5) to Freenas using Rsync, but I don't know exactly how to do this via the GUI as it seems that only backup of data FROM Freenas TO another server is possible, and not viceversa.
Is there a way to backup data FROM an external server TO Freenas with rsync? Or if not, is it possible to do it via the command line?
Thank you very much.

Roberto
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
FreeNAS can do both, if you want to configure the rsync job from the FreeNAS gui then add a rsync job. choose 'pull' as the method. If your using rsync over ssh then you need to setup your ssh keys so that whatever user you use to run rsync in freenas can just 'ssh user@centosip' and get to a shell with permissions to read the needed files.

It is very, very possible =]
 

roby84

Dabbler
Joined
Jun 17, 2012
Messages
11
I'm sorry but I can't see any "pull" option when I add an rsync task. As I can see this option is instead present in the documentation of Freenas.
Am I running a version that doesn't include this feature? My version is 8.0.3-RELEASE-p1-x64 (not so old).
If it is so, is there an alternative way to use the pull method without having to upgrade?
Thank you
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
sorry, I think they put in changes since the version you are running. You might want to upgrade to the latest stable, 8.0.4
 

roby84

Dabbler
Joined
Jun 17, 2012
Messages
11
Thank you for your info, but I think I need something more advanced than simply transfer files and folders from one machine to another.

What I need is to make an exact copy of the WHOLE server (including all system files, file system, etc) and copy it inside a folder on Freenas, so that if a hardware failure should occur, I could replicate the entire system on another machine. Another thing I need is to make automatic copies (snapshots) of the system and keep the old ones, so that I am able to decide which date choose to recover data from.

Another problem are file permissions, because since I want to use SSH for file transfers (for security reasons), I don't want to use the "root" user to connect to the machine I want to backup, but it seems I cannot use any other user, since normal users don't have permission to access the files. Maybe there's a way to give a normal user full access to the system, but I don't know how to do it.

Another problem is that after rsyncing files from my server to Freenas, the owners are shown as their ID on the Freenas and not with their usernames.

Is Rsync able to accomplish all this?

Thank you very much.

Roberto
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Is Rsync able to accomplish all this?

Thank you very much.

Roberto

Yes, it can do all of that, but you're going to need to do some studying. Rsync is VERY diverse and has so many possibilities is difficult to know and explain them all.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
You could rsync the WHOLE system, just backup '/', recursively, with permissions (archive mode). To access (read) every file on your CentOS box the use rsync connects as needs to be either root or have sudo priveledges. Some files, such as your password files, can only be read by the root user. What I recommend is you install sudo on your CENTOS box, allow sudo access to a limited rsync user, and read the sudo man pages to modify your sudoers file to allow read access for the limited rsync user.

If you need snapshots I recommend rsyncing to a dataset on your freenas box, then snapshoting that dataset after every rsync. This can all be configured in the FreeNAS gui.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You just need to pay attention to the correct options to rsync if you do the WHOLE system. You need to tell rsync how to handle device files and symbolic links, there's even an option for sparse files to speed up the copy.
 
Status
Not open for further replies.
Top