- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tar a list of files...
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
Discussions
Discussions
Discussions
Forums
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
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
тАО06-14-2007 07:40 AM
тАО06-14-2007 07:40 AM
This seems pretty basic but I am unsure.
I have afile located in /tmp that has a list of files....i want to tar each of those files into one tar ball.
so, lets say the filename of the list of files is /tmp/aa how do i tell the tar to go get those files nad only create on tar ball?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 07:42 AM
тАО06-14-2007 07:42 AM
Re: tar a list of files...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 07:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 08:35 AM
тАО06-14-2007 08:35 AM
Re: tar a list of files...
if there are many files in /tmp/myfiles to be archived, you can use 'pax', which can write tar-format but can read the files to be archived from stdin as well:
pax -w -f myarchive.tar
That way you won't get a 'arglist too long' error.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 01:31 PM
тАО06-14-2007 01:31 PM
Re: tar a list of files...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 05:34 PM
тАО06-14-2007 05:34 PM
Re: tar a list of files...
--files-from=file
-T file
tar will use the contents of file as a list of archive members or files to
operate on, in addition to those specified on the command-line. See files.
http://www.gnu.org/software/tar/
http://www.gnu.org/software/tar/manual/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 07:24 PM
тАО06-14-2007 07:24 PM
Re: tar a list of files...
I want to warn, using the xargs-solution above:
Since - with a long filename list - the xargs calls multiple times and the option 'c' is used, the tarfile will contain only the files of its last execution.
An update/append option is possible, however.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2007 07:29 PM
тАО06-14-2007 07:29 PM
Re: tar a list of files...
This will just overwrite aa.tar when xargs repeats. Also, you should not be using cat:
$ xargs tar -cvf < /tmp/aa
Similarly use:
$ tar -cvf aa.tar $(< /tmp/aa)
Of course Peter and Steven have the solution for infinite number of files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2008 07:02 AM
тАО01-31-2008 07:02 AM