I was using the following copy command to take backup of my datastore
cp -pr $src $dest
Which gives me the following warning while using with NFS and returns an error code but the files are actually getting copied.
cp: preserving times for ‘$src/file1’: Invalid argument
Is there any alternative method to do this? I want to get rid of the warnings and wrong return code. I do not care about preserving time stamps, but other attributes such as mode and ownership should be preserved.