I've mounted my NAS drive under the /media/ directory. I've copied a bunch of files from my current /var/www directory, using cp -Rpv (preserve). Now I want to do a

cp -Rup /var/www/ /media/magneto/testing.cdw/

Based on the fact that these are two different file systems, i.e. one is a networked NAS connected through Samba, and the other is my computers internal drive.

Will I run into problems with the date and time? how can I check before I run the copy?


According to the man page for cp, -p should certainly preserve the timestamps. I don't think that the filesystem would cause an issue.


If you want to have differential updates to a filesystem then the de facto tool to use is rsync. You can run it in dry-run mode (-n) to see which files it will transfer before the actual operation.


The safest thing to do is copy 1 small file, then test.

Over a network connection, rsync provides better options for recovery than cp -R, as in my experience, bulk copies to NAS often run into problems.

Whether or not date and time copy properly will depend on a number of factors, including the underlying FS on the NAS, and quite how the NAS is exposing SMB/CIFS - this can vary from manufacturer to manufacturer, and browser-configured permissions aren't always quite what you expect.


I have also a NAS on my LAN, I'm using cronjobs to rsync data from 3 LAN nux machines to the NAS. rsync is using ssh so you just need to make sure of public/private key exchanges between both machines. I'm using keychain for this. This works perfectly in my case. No stress about backups then.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.