Quantcast
Viewing all articles
Browse latest Browse all 10

Getting Linux copy to handle failing links

Image may be NSFW.
Clik here to view.
Question

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.m4ls -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 ?

Image may be NSFW.
Clik here to view.
Answer

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.


Viewing all articles
Browse latest Browse all 10

Trending Articles