I want to create a zipped output file while keeping the original one
up vote
1
down vote
favorite
I want to create a zipped output file while keeping the original one. I want to do it from Informatica end by using command task or session task.
Below is the example which I am trying:
In session task: Command type='Command',
Command=gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
In case of using Command task:
gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
I tried both things, but zip file is not at all created.
Below is the screen shot:

shell-script
add a comment |
up vote
1
down vote
favorite
I want to create a zipped output file while keeping the original one. I want to do it from Informatica end by using command task or session task.
Below is the example which I am trying:
In session task: Command type='Command',
Command=gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
In case of using Command task:
gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
I tried both things, but zip file is not at all created.
Below is the screen shot:

shell-script
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to create a zipped output file while keeping the original one. I want to do it from Informatica end by using command task or session task.
Below is the example which I am trying:
In session task: Command type='Command',
Command=gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
In case of using Command task:
gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
I tried both things, but zip file is not at all created.
Below is the screen shot:

shell-script
I want to create a zipped output file while keeping the original one. I want to do it from Informatica end by using command task or session task.
Below is the example which I am trying:
In session task: Command type='Command',
Command=gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
In case of using Command task:
gzip -c /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
I tried both things, but zip file is not at all created.
Below is the screen shot:

shell-script
shell-script
edited Nov 25 at 22:34
Rui F Ribeiro
38.3k1477127
38.3k1477127
asked Mar 21 '14 at 9:22
Infa_unix
613
613
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
4
down vote
You can keep original file by using -c options and redirect output to another file:
gzip -c file > file.gz
It will keep your original file unchange and create its gzip file named file.gz
add a comment |
up vote
0
down vote
Your zip file isn't being created because the -c option for gzip means that the compressed file is sent to stdout instead of being written to disk. For what you want, you could either do what Laurent suggested in his comment, or you could use zip instead of gzip, which leaves the original files as well as creating a .zip file:
zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out.zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
Or:
cd /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/ && zip tgt_zip tgt_zip
add a comment |
up vote
0
down vote
gzip -c reads a file (or standard input when file name is - ) and writes a compressed version to standard output.
So save contents to a new file then stdout redirection can be used.
gzip -c inputfile >outputfile
To simply compress in place and produce inputfile.gz
gzip inputfile
If informatica is ignoring the stdout redirection, you could pass the whole command to a shell (sh, csh, bash, ...) and let it do it instead,
Command=sh -c "gzip -c filename > newfilename"
I'm not an informatica user, so their forum for more information on that product here.
edit 1
Here's a simple script to use from informatica which hides i/o redirection.
$ cat infagzip.sh
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage $0 : inputfile outputfile "
exit 1
fi
gzip -c "$1" > "$2"
Now your Command line should look like this
/path/to/infagzip.sh inputfilename outputfilename
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
You can keep original file by using -c options and redirect output to another file:
gzip -c file > file.gz
It will keep your original file unchange and create its gzip file named file.gz
add a comment |
up vote
4
down vote
You can keep original file by using -c options and redirect output to another file:
gzip -c file > file.gz
It will keep your original file unchange and create its gzip file named file.gz
add a comment |
up vote
4
down vote
up vote
4
down vote
You can keep original file by using -c options and redirect output to another file:
gzip -c file > file.gz
It will keep your original file unchange and create its gzip file named file.gz
You can keep original file by using -c options and redirect output to another file:
gzip -c file > file.gz
It will keep your original file unchange and create its gzip file named file.gz
answered Mar 21 '14 at 10:04
cuonglm
101k23197299
101k23197299
add a comment |
add a comment |
up vote
0
down vote
Your zip file isn't being created because the -c option for gzip means that the compressed file is sent to stdout instead of being written to disk. For what you want, you could either do what Laurent suggested in his comment, or you could use zip instead of gzip, which leaves the original files as well as creating a .zip file:
zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out.zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
Or:
cd /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/ && zip tgt_zip tgt_zip
add a comment |
up vote
0
down vote
Your zip file isn't being created because the -c option for gzip means that the compressed file is sent to stdout instead of being written to disk. For what you want, you could either do what Laurent suggested in his comment, or you could use zip instead of gzip, which leaves the original files as well as creating a .zip file:
zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out.zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
Or:
cd /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/ && zip tgt_zip tgt_zip
add a comment |
up vote
0
down vote
up vote
0
down vote
Your zip file isn't being created because the -c option for gzip means that the compressed file is sent to stdout instead of being written to disk. For what you want, you could either do what Laurent suggested in his comment, or you could use zip instead of gzip, which leaves the original files as well as creating a .zip file:
zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out.zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
Or:
cd /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/ && zip tgt_zip tgt_zip
Your zip file isn't being created because the -c option for gzip means that the compressed file is sent to stdout instead of being written to disk. For what you want, you could either do what Laurent suggested in his comment, or you could use zip instead of gzip, which leaves the original files as well as creating a .zip file:
zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out.zip /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/tgt_zip.out
Or:
cd /var/opt/powermart/pc8_dev/infa_shared/TgtFiles/test1/ && zip tgt_zip tgt_zip
answered Mar 21 '14 at 9:56
Josh Jolly
1,322812
1,322812
add a comment |
add a comment |
up vote
0
down vote
gzip -c reads a file (or standard input when file name is - ) and writes a compressed version to standard output.
So save contents to a new file then stdout redirection can be used.
gzip -c inputfile >outputfile
To simply compress in place and produce inputfile.gz
gzip inputfile
If informatica is ignoring the stdout redirection, you could pass the whole command to a shell (sh, csh, bash, ...) and let it do it instead,
Command=sh -c "gzip -c filename > newfilename"
I'm not an informatica user, so their forum for more information on that product here.
edit 1
Here's a simple script to use from informatica which hides i/o redirection.
$ cat infagzip.sh
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage $0 : inputfile outputfile "
exit 1
fi
gzip -c "$1" > "$2"
Now your Command line should look like this
/path/to/infagzip.sh inputfilename outputfilename
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
add a comment |
up vote
0
down vote
gzip -c reads a file (or standard input when file name is - ) and writes a compressed version to standard output.
So save contents to a new file then stdout redirection can be used.
gzip -c inputfile >outputfile
To simply compress in place and produce inputfile.gz
gzip inputfile
If informatica is ignoring the stdout redirection, you could pass the whole command to a shell (sh, csh, bash, ...) and let it do it instead,
Command=sh -c "gzip -c filename > newfilename"
I'm not an informatica user, so their forum for more information on that product here.
edit 1
Here's a simple script to use from informatica which hides i/o redirection.
$ cat infagzip.sh
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage $0 : inputfile outputfile "
exit 1
fi
gzip -c "$1" > "$2"
Now your Command line should look like this
/path/to/infagzip.sh inputfilename outputfilename
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
add a comment |
up vote
0
down vote
up vote
0
down vote
gzip -c reads a file (or standard input when file name is - ) and writes a compressed version to standard output.
So save contents to a new file then stdout redirection can be used.
gzip -c inputfile >outputfile
To simply compress in place and produce inputfile.gz
gzip inputfile
If informatica is ignoring the stdout redirection, you could pass the whole command to a shell (sh, csh, bash, ...) and let it do it instead,
Command=sh -c "gzip -c filename > newfilename"
I'm not an informatica user, so their forum for more information on that product here.
edit 1
Here's a simple script to use from informatica which hides i/o redirection.
$ cat infagzip.sh
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage $0 : inputfile outputfile "
exit 1
fi
gzip -c "$1" > "$2"
Now your Command line should look like this
/path/to/infagzip.sh inputfilename outputfilename
gzip -c reads a file (or standard input when file name is - ) and writes a compressed version to standard output.
So save contents to a new file then stdout redirection can be used.
gzip -c inputfile >outputfile
To simply compress in place and produce inputfile.gz
gzip inputfile
If informatica is ignoring the stdout redirection, you could pass the whole command to a shell (sh, csh, bash, ...) and let it do it instead,
Command=sh -c "gzip -c filename > newfilename"
I'm not an informatica user, so their forum for more information on that product here.
edit 1
Here's a simple script to use from informatica which hides i/o redirection.
$ cat infagzip.sh
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage $0 : inputfile outputfile "
exit 1
fi
gzip -c "$1" > "$2"
Now your Command line should look like this
/path/to/infagzip.sh inputfilename outputfilename
edited Mar 21 '14 at 11:37
answered Mar 21 '14 at 10:07
X Tian
7,57111936
7,57111936
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
add a comment |
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
I tried above logic but end up with below error: Error: [tgt_zip] Process id 17626. The shell command failed with exit code 1.
– Infa_unix
Mar 21 '14 at 10:18
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
Your problem appears to be the informatica interface, write a simple shell command that just takes the parameters you require which can hide redirection and punctuation characters to informatica if this is causing the problem. BTW, you didn't try the sh method above.
– X Tian
Mar 21 '14 at 10:35
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
@X Tian, if I ran first command in putty, it is giving expected result, but not in Inforamatica. I tried sh method also. its not working at Infa level.
– Infa_unix
Mar 21 '14 at 11:18
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
Write a simple shell script to do what you want. and call that instead of gzip directly.
– X Tian
Mar 21 '14 at 11:19
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f120723%2fi-want-to-create-a-zipped-output-file-while-keeping-the-original-one%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown