Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just started using the nifty rsnapshot utility for backups to our NAS. I really like the tool (which uses rsync and links unchanged files to keep the backup size down), but I'm running into problems copying certain links, e.g:

sudo /bin/cp -al /NAS/Backups/rsnapshot/hourly.0 /NAS/Backups/rsnapshot/hourly.1
/bin/cp: cannot create link `/NAS/Backups/rsnapshot/hourly.1/hourly.0/percival/home/stuffs/Workspaces/AppscioWork/MPF.bad/mpf-core/gtk-doc.make': No such file or directory

I'm not sure what is going on here, as the source file exists and has read permissions:

ls -l /NAS/Backups/rsnapshot/hourly.0/percival/home/stuffs/Workspaces/AppscioWork/MPF.bad/mpf-core/m4/gtk-doc.m4
lrwxrwxrwx. 1 nobody nobody 29 2009-12-30 22:38 /NAS/Backups/rsnapshot/hourly.0/percival/home/stuffs/Workspaces/AppscioWork/MPF.bad/mpf-core/m4/gtk-doc.m4 -> /usr/share/aclocal/gtk-doc.m4

ls -l /usr/share/aclocal/gtk-doc.m4
-rw-r--r--. 1 root root 1324 2009-02-24 17:50 /usr/share/aclocal/gtk-doc.m4

Is there a way to either fix this error, or have the cp command ignore the error and keep going ?

share|improve this question
up vote 1 down vote accepted

The problem your having is not a permission problem, or you would get "Permission denied".

The -l option tells cp to use links instead of actually copying the file. I believe it uses hard links, so you may be out of luck because hard links cannot cross file systems (aka link from one mount point to another mount point).

Try running the command with out the -l to see if it eliminates the error.

share|improve this answer
Thanks, you hit the nail on the head - the failing links are pointing to files on a different mount point. Is there a way to tell cp to just ignore these errors and carry on ? – gareth_bowles Jan 5 '10 at 23:20
I haven't seen an "ignore errors" option for cp. Try rsync, it will copy the files and will continue after reporting the error. – David Jan 6 '10 at 5:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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