- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to compress entire directory and it's subs
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
тАО09-07-2010 06:58 AM
тАО09-07-2010 06:58 AM
How to compress entire directory and it's subs
Dear Guys
How do I compress entire directory including it's subs, dba's would like to compressed/zip in tar ball of this huge logs directory so they can upload it to their support online..
I want to use tar command to zip all of this, or perhaps gzip utility,,,can u pls let me know the correct syntax and command..
so for e.g I want to compress /frog directory and all of it's contents and place a zip ball into destination /somefilesystem ?
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 07:11 AM
тАО09-07-2010 07:11 AM
Re: How to compress entire directory and it's subs
# cd /path
# tar -cvf /var/tmp/myarchive.tar ./mystuff
# gzip /var/tmp/myarchive.tar
This gives you '/tmp/myarchive.tar.gz' which is a compressed archive of the './mystuff' directory and all its contents.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 07:33 AM
тАО09-07-2010 07:33 AM
Re: How to compress entire directory and it's subs
If you want to omit intermidiate file creation, the command may look as follows:
tar -cvf - PATH_TO_LOG_DIRECTORY| gzip > rezfile.tar.gz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 07:35 AM
тАО09-07-2010 07:35 AM
Re: How to compress entire directory and it's subs
# cd /path
# tar cvf - ./mystuff |gzip >/var/tmp/myarchive.tar.gz
or use gnu tar and use tar cvzf /var/tmp/myarch.tgz ./mystuff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 07:42 AM
тАО09-07-2010 07:42 AM
Re: How to compress entire directory and it's subs
> # gzip /var/tmp/myarchive.tar
Or using the latest "pipeline" technology:
tar cf - ./mystuff | \
gzip > /var/tmp/myarchive.tar
> I want to use tar command to zip all of
> this, or perhaps gzip utility,,,
It might help if you explained what you wish
to do, rather than how you wish to do it.
"tar" collects files, but does not itself
compress. If the people receiving the file
are not using a UNIX(-like) system, then Zip
might be a better choice than tar+gzip.
> [...] it's subs [...]
> [...] it's contents [...]
"its".
> [...] for e.g [...]
"e.g." or "for example".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 11:11 AM
тАО09-07-2010 11:11 AM
Re: How to compress entire directory and it's subs
Thanks Team I've got what I wanted,
By the way tar command will tar all the subdirectories and their contents as well rite?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 11:34 AM
тАО09-07-2010 11:34 AM
Re: How to compress entire directory and it's subs
> By the way tar command will tar all the subdirectories and their contents as well rite?
Yes.
In fact, you can answer this yourself with a simple test :-)
Regards!
...JRF...