Copy an entire folder tree
Hi,
I am trying to use the cp command to copy some files around but want to preserve the entire folder structure. Example: cp /folder1/folder2/file /backup Then within the /backup location I want to see /backup/folder1/folder2/file. I have tried cp -a and cp -p but neither give me the above. Any suggestions? Thanks. |
Hi,
Is this what you are looking for? cp --parents /folder1/folder2/file /backup Hope this helps. |
Thanks Druuna that works perfectly :)
However, when I now run that in the following script I get 'cp: omitting directory' errors: Code:
NAGIOS_FILES="/usr/local/nagios/etc/nagios.cfg \ Thanks. |
Quote:
|
All times are GMT -5. The time now is 12:55 AM. |