- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- copy files question..!?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 09:05 PM
04-09-2006 09:05 PM
I would like to copy all the files in the root filesystem "/" to a new directory, and which need to exclude the /stand, /var, /opt ...etc.
i.e. /etc --> /new/etc, /bin --> /new/bin and /.profile --> /new/.profile
any idea?
Warren
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 09:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 06:09 PM
04-10-2006 06:09 PM
Re: copy files question..!?
1 - mkdir /new
2 - cd /
3 - tar -cf --exclude /stand --exclude /var --exclude /opt . | (cd /new && tar -xvf -)
Instead of repeating option "--exclude", you can create a file with the files and directories you want to exclude (exclude.lst) and use option "-X exclude.lst".
This makes a tar ball directed to stdout, piped to stdin and un-tared after change to directory "new".
Good luck! /JB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 08:00 PM
04-10-2006 08:00 PM
Re: copy files question..!?
I tried you method but it created a "--X" file in the source dir and didn't copy any file.
I cannot find the tar option exclude OR -X...
following is my command, and
# cd /tmp/test/source
# tar -cf --X exclude.lst . | (cd /tmp/test/target | tar -xf -)
thanks,
Warren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:55 PM
05-09-2006 08:55 PM