- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About "Tar" function
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
12-02-2003 08:09 PM
12-02-2003 08:09 PM
About "Tar" function
eg.
# cd /home
# ls
ACC
EDP
ENG
MKT
SAL
how can I use tar to backup all the /home directory , but skip the dirctory "EDP" ? thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 08:14 PM
12-02-2003 08:14 PM
Re: About "Tar" function
tar -cvf /dev/rmt/0m `find /home | grep -v /home/EDP`
-Denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 08:18 PM
12-02-2003 08:18 PM
Re: About "Tar" function
find . | grep -v '^EDP' | pax -w -f
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 08:24 PM
12-02-2003 08:24 PM
Re: About "Tar" function
However, I fear that you could end up having the old and irritating "too many arguments" error with the solution proposed. Just to be on the safe side, I would add the "-type d" to the arguments of "find" in Denvers solution, just to reduce the chances of this happening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 09:18 PM
12-02-2003 09:18 PM
Re: About "Tar" function
In that case, you could do it like this:
tar cvf
Which gives a lot shorter command line, but still can give the same error with too many arguments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 09:27 PM
12-02-2003 09:27 PM
Re: About "Tar" function
GNU "tar" has a "-T filename" option where filename is a file containing the names of the files to backup or restore. If using GNU tar you could just have the names of the directories in there. I remember this was "-F" on SCO "tar" about 100 years ago.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 09:31 PM
12-02-2003 09:31 PM
Re: About "Tar" function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 11:21 PM
12-02-2003 11:21 PM
Re: About "Tar" function
tar cf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 11:36 PM
12-02-2003 11:36 PM
Re: About "Tar" function
# tar -cvf /dev/rmt/0m 'cat /tmp/home.out'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2003 01:29 AM
12-03-2003 01:29 AM
Re: About "Tar" function
tar cvf /dev/rmt/0m `find /home -type d |grep -v -E '^/home/dir1$|^/home/dir1/subdir2$|^/home/dir3'`
the above will archive all that is in home, /home/dir1/subdir2 and /home/dir3 will not be archived.
To test it out for yourself, run a few find commands piped to grep w/out using tar. What ever is displayed to your screen is what tar would include in the archive.
Hope this helps,
-Denver