[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem selecting options for cp command



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Sep 05, 2016 at 07:29:52AM -0500, Richard Owlett wrote:
> I attempted to copy contents of one partition to another using
>    cp -R /media/richard/myrepo /media/richard/test
> 
> /media/richard/myrepo is a hard disk partition
> /media/richard/test   is a USB flash drive
> 
> I received "illegal operation" error messages as symbolic links were
> encountered.
> "man cp" was too terse to be illuminating.

First: what do you *want*?
  (a) if cp finds a link it should copy it as a (now possibly
    dangling) link)
  (b) it should copy (recursively) the contents of the dir
    the link points to.

Once you are clear, it's easier to decide

Hint: when doing backup, you almost always want cp -a (*not* -R).
It will copy the links as links. If they point to some place
outside the tree under copy, they are dangling links in the copy.
On backups you almost always want that.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlfNamQACgkQBcgs9XrR2kbzmACffqDzwcIiLQ0mUhNFgfHNj3pF
jQEAniafWEURYJx7Q1kDt8E+h+U0U2yJ
=O7Ig
-----END PGP SIGNATURE-----


Reply to: