Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rsync vs nfs4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Sun Jun 09, 2019 8:36 am    Post subject: rsync vs nfs4 Reply with quote

Greetings,

I have a folder on server 1 which I want to backup on server 2, server 1 has it exported via nfsv4
I've found old disscussions regarding the issue stating that for file transfer,. rsync is better than nfs.
I wonder if it is still the case nowadays and when using nfsv4

can anyone comment on this?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sun Jun 09, 2019 11:43 am    Post subject: Reply with quote

Nfs is not used for backing up folders -- just for sharing folders over a network which then a client would mount and use as if they were local to that machine.
What you CAN do is mount the nfs folder and then just copy it to some other directory,tar it or whatever you like.
OR
Just use rsync over ssh:
Code:

rsync -avz -e ssh root@<remote-host>:</path/to/remote/directory> </path/to/local/directory>

It goes without saying that ssh key authentication is prefered.

:)
Back to top
View user's profile Send private message
C5ace
Guru
Guru


Joined: 23 Dec 2013
Posts: 472
Location: Brisbane, Australia

PostPosted: Sun Jun 09, 2019 11:56 am    Post subject: Reply with quote

I use both.

Desktop-1 user "A" and a number of laptops users "B", "C" , etc. connect with NFS to folder-1/user "A", "B", etc on server-1.

Folder-1 and subfolders on server-1 are backed up daily to /home/backup on desktop-1 using rsnapshot (rsync).
_________________
Observation after 30 years working with computers:
All software has known and unknown bugs and vulnerabilities. Especially software written in complex, unstable and object oriented languages such as perl, python, C++, C#, Rust and the likes.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Sun Jun 09, 2019 2:15 pm    Post subject: Reply with quote

thanks, I'll try using nfsv4.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun Jun 09, 2019 11:04 pm    Post subject: Reply with quote

DaggyStyle,

rsync can be much faster, especially if you have many small files:
  1. On my NFS server:
    Code:
    cd /tmp
    time cp -a /usr/portage .
    4.3 seconds    # first run
    2.4 seconds    # second run, it's faster because data is in cache

  2. On my NFS client (/usr/portage is mounted from NFS server, GigabitEthernet link):
    Code:
    cd /tmp
    time cp -a /usr/portage .
    191 seconds    # first run
    188 seconds    # second run, no difference

  3. On my NFS client (connected to NFS server via GigabitEthernet link):
    Code:
    cd /tmp
    time rsync -a <user>@<IP address of NFS server>:/usr/portage .
    2,8 seconds    # first run
    2,7 seconds    # second run, no difference

3 seconds instead of 190 seconds... That's much better, isn't it?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum