1

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 ?

1 Answer 1

1

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.

2
  • 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 ? Commented Jan 5, 2010 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
    Commented Jan 6, 2010 at 5:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .