* [email protected]
| source directory tree: /rhk
| destination directory mount point: /back/rhk
| desired destination directory tree path: /back/rhk (and not /back/rhk/rhk)
>
| In this case I would expect to use a cp command as follows:
>
| cp -aux /rhk/* /back/rhk/
>
| Example 2: other times I want to copy an entire directory tree (i.e., with 
| subdirectories) to a different location but (rooted) one level below the 
| directory mount point: 
>
| source directory tree: /rhk
| destination directory mount point: /back
| desired destination directory tree path: /back/rhk
>
| In this case I would expect to use a cp command as follows:
>
| cp -aux /rhk/* /back/rhk/ <oops??? the same command?? -- would this work?>

The difference is that in 1) you have _no_ directory rhk/ on the backup
medium (since it is mounted at /back/rhk, which is on the host, not the
backup disk), whereas in 2) you *will* have a directory rhk/ on the backup
medium (which you need to create after mounting the backup medium,
before the 'cp').

| Also, there might be a better command than cp to do this, but I'd like to 
| understand how to do it with the cp command.  (Aside: there is no need for 
| rsync (although it could be used) because the backup disk will be mounted on 
| the computer.)

I would suggest rsync -av, even on a locally mounted disk.
Saves huge amount of time on the second ff run.  It would even create
any target directory for you, which cp will not do (this might or might
not be desirable, YMMV).

R'

Reply via email to