[Novalug] Having problems copying data using cp over nfs

Jay Hart jhart@kevla.org
Tue Jun 19 21:09:25 EDT 2007



> On Mon, Jun 18, 2007 at 08:49:44PM -0400, Jay Hart wrote:
>> I am in the process of standing up my NAS server.  I am trying to copy off
>> all
>> my users Maildir directories to the NAS box as a file backup.
>>
>> So, my account on the box, has 93MB of data in the Maildir folder, in 160
>> subfolders and includes 3217 files. (reported by fish)
>>
>> What I have managed to copy over is 7.3MB of data, in 160 folders, and 553
>> files were copied over.
>>
>> I used the following command:
>>
>> cp -r /home/jhart/Maildir/* /mntpoint/email/home/jhart/Maildir
>>
>> I figured this would recursively copy all files under the Maildir dir to the
>> new location.
>>
>> Why didn't all files get copied over? What did I do wrong? What would work?
>
> Jay,
>
> In addition to the responses that you've already gotten, this would be
> more efficient if you used the rsync command, assuming it is available
> to you on the local system.
>
> rsync --archive /home/jhart/Maildir/ /mntpoint/email/home/jhart/Maildir
>
> Should do what you need!  The main advantage of using rsync over cp is
> that secondary and subsequent "copies" only copy the data which has
> changed.
>
> To remove files that are in the old backup, that are not in the
> current files, use:
>
> rsync --delete --archive /home/jhart/Maildir/
> /mntpoint/email/home/jhart/Maildir

Using this method, one of my accounts is now synced, the other still shows 3
files more on the backup then the original Maildir folder on the email server.

FreeNAS has a rsync daemon, should I be running that as a server based service
for this to be really effective?

Jay

>
> Not sure what services are running on the NAS, but it is
> also possible to do something like the following, in-case there is an
> issue with the way the NAS directory is being mounted, locally:
>
> rsync --archive /home/jhart/Maildir/ nasbox:/nas-path/to/jhart/Maildir
>
> And this will run rsync over ssh.  You can add --verbose (-v) to any
> of the above commands to see what they are doing, as they operate.
>
> 				 -rob
>





More information about the Novalug mailing list