- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Too many resources required when I use "gzip"
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
08-23-2006 04:17 AM
08-23-2006 04:17 AM
Re: Too many resources required when I use "gzip"
I'm not really sure to understand how it works...I don't know perl language...
I use the command "gzip toto.tar" to obtain the file "toto.tar.gz" : but how to "integrate" these parameters in your perl script ?
Thanks a lot !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 04:19 AM
08-23-2006 04:19 AM
Re: Too many resources required when I use "gzip"
e.g. "ln -s /opt/perl/bin/perl /usr/bin/perl"
/usr/bin is a much more standard location and if you create the symbolic link, all of your future Perl scripts will be much more portable.
----------------------------------------
"./cppause.pl gzip toto.tar"
You really messed this up. Note that I said that this Perl script reads standard input (in binary) and outputs to standard output. In your case, stdin is your terminal and so is sdout so it will wait until your type a Ctrl-D (EOF).
Here is how you should have done it and created a pipeline:
cppause.pl < toto.tar | gzip > toto.tar.gz
Now if you wanted to specify read 20 chunks at a time of 32768 bytes and pause 3 seconds between each 20 chunks then the command would be:
cppause.pl -b 32768 -p 20 -s 3 < toto.tar | gzip > toto.tar.gz
Of course, had you bothered to "cppause.pl -u", you would have seen this for yourself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 06:20 AM
08-23-2006 06:20 AM
Re: Too many resources required when I use "gzip"
Well I read the help of the command but I didn't remember how to "work" with stdin...
In fact, I tried the command :
"cppause.pl < gzip toto.tar > toto.tar.gz"
I knew it was not the good command...almost the good one !!! I forgot the pipes :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 06:28 AM
08-23-2006 06:28 AM
Re: Too many resources required when I use "gzip"
For example :
"cppause.pl < toto | tar cvf > toto.tar"
(toto is a directory...)
I'm going to try immediately !
(And the command "vi" to edit a big big text file ?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 06:45 AM
08-23-2006 06:45 AM
Re: Too many resources required when I use "gzip"
tar cvf - toto | cppause.pl > toto.tar
Note the "-" following f; this tells tar to write on stdout. Since you are trying to do this with tar, this suggest that your problems extend beyond gzip.
You really need to have someone who understands UNIX look at your applications and the system configuration because "fix'es" like throttling i/o should not be needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 07:09 AM
08-23-2006 07:09 AM
Re: Too many resources required when I use "gzip"
"cppause.pl < toto.tar | gzip > toto.tar.gz" means :
1) "toto.tar" is the entry (stdin) for "cppause.pl"
2) "| gzip" means the result of the "first step" is "sent" (piped) to the command "gzip"
3) "> toto.tar.gz" means the stdout of the "gzip" is the file "toto.tar.gz"
Is it the "good" explication ?
Why can I not use the syntax :
"gzip toto.tar | cppause.pl > toto.tar.gz" ? (like the syntax you give me for "tar")
Is it because "gzip toto.tar" is not the "good" entry (stdin) ? It's the file "toto.tar" which is the good one for the script cppause.pl, isn't it ?
In fact I have difficulties to understand the syntax you give me for the command "tar"...because it seems there is no stdin anymore for the perl script, no ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 07:24 AM
08-23-2006 07:24 AM
Re: Too many resources required when I use "gzip"
"cppause.pl < toto.tar | gzip > toto.tar.gz" means :
1) "toto.tar" is the entry (stdin) for "cppause.pl"
2) "| gzip" means the result of the "first step" is "sent" (piped) to the command "gzip"
3) "> toto.tar.gz" means the stdout of the "gzip" is the file "toto.tar.gz"
Is it the "good" explication ?
A. YES, ALL OF THAT IS CORRECT.
---------------------------------------
Why can I not use the syntax :
"gzip toto.tar | cppause.pl > toto.tar.gz" ? (like the syntax you give me for "tar")
A. THE SHORT ANSWER IS THAT IT IS WRONG.
If I "gzip toto.tar" that tells gzip to read the file toto.tar and rewrite it as toto.tar.gz. Nothing is written on stdout.
It might make more sense to you if I rewrite
cppause.pl < toto.tar | gzip > toto.tar.gz
to this:
cat toto.tar | cppause.pl | gzip > toto.tar.gz
Both forms are equivalent but the cat is unnecessary and because another process must be spawned, it is less efficient -- but it might be a clearer form for you to grasp.
You really need to find a basic shell scripting book and study input/output redirection. None of this is actually related to Perl, it is nothing more (and nothing less) than shell i/o redirection.
You should also study the gzip and tar man pages to understand the behavior when these utilities interact with stdin and stdout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2006 07:34 AM
08-23-2006 07:34 AM
Re: Too many resources required when I use "gzip"
Well I work using Unix but just a little bit :) I'm discovering...
- « Previous
-
- 1
- 2
- Next »