06-16-2009
use gzip instead of compress
Hi,
I need to modify a script wherein need to use gzip instead of compress.
The script is
# cat dly_appsfiles_bkp.ksh
#
# dly_appsfiles_bkp.ksh
#
date_stamp=`date +%m%d%y`
base_dir=/u05/gld1
sub_dir=apps
bkp_dir=/u00/backup/GLD1/APPS
bkp_file_name=${sub_dir}_${date_stamp}.tar.Z
echo ""
echo "Starting Compressed Apps Files backup ..."
echo "Compressed backup file name: ${bkp_dir}/${bkp_file_name}"
echo ""
cd ${base_dir}
tar cvf - ${sub_dir} | compress > ${bkp_dir}/${bkp_file_name}
echo ""
cd $bkp_dir
ls -ltr *.Z
mailx -s "Done"
abc@abc.com<<EOF
Backup done
EOF
echo ""
echo "Done."
echo ""
Please let me know how this can me modified?
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have hundreds of ".Z" files that I need to uncompress and gzip. I'm not sure how to handle this in a 'for loop'. I can get the uncompress part, but I'm not sure how to strip the .Z off the filename for the gzip step. Is it possible to pipe the output of uncompress to gzip? (2 Replies)
Discussion started by: 98_1LE
2 Replies
2. UNIX for Advanced & Expert Users
Hello.
Can any1 help me with the compress command.
The -b option takes the number of bits used for encoding.
can u expalin why this number of bits is used and for what purpose. what is the maximum number we can provide?
In SFU these number has a valod range between 12 and 16 y?? (1 Reply)
Discussion started by: rahulrathod
1 Replies
3. SCO
Hello.
Can any1 help me with the compress command.
The -b option takes the number of bits used for encoding.
can u expalin why this number of bits is used and for what purpose. what is the maximum number we can provide?
In SFU these number has a valod range between 12 and 16 y?? (1 Reply)
Discussion started by: rahulrathod
1 Replies
4. UNIX for Dummies Questions & Answers
hi can i know the diff between these 2 commands in terms of data compressed (3 Replies)
Discussion started by: anandapani
3 Replies
5. UNIX for Dummies Questions & Answers
People i have files.arc i need to compress one by one...but they need to have the same date for example
jan 30 1234.arc
jan 30 12334.arc
jan 30 rejrne.arc
jan 30 e423e4.arc
jan 30 afdhnfhd.arc
jan 31 aresdfds.arc
I need to compres the jan 30 .arc only
thank you very much (1 Reply)
Discussion started by: enkei17
1 Replies
6. UNIX for Dummies Questions & Answers
Hi All !
We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows.
I have used the utility ZIP like the below.
zip -e <newfilename> df2_test_extract.dat
but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
Discussion started by: sakthifire
4 Replies
7. UNIX for Advanced & Expert Users
Hi,
in AIX 6.1 what is the limite of gzip and compress ?
I mean what can be at most the size of the file to compress ?
Thank you. (1 Reply)
Discussion started by: big123456
1 Replies
8. UNIX for Advanced & Expert Users
Hi All,
I have a random test file: test.txt, size: 146
$ ll test.txt
$ 146 test.txt
Take 1:
$ cat test.txt | gzip > test.txt.gz
$ ll test.txt.gz
$ 124 test.txt.gz
Take 2:
$ gzip test.txt
$ ll test.txt.gz
$ 133 test.txt.gz
As you can see, gzipping a file and piping into gzip... (1 Reply)
Discussion started by: hanfresco
1 Replies
9. Shell Programming and Scripting
Are the above commands does the same job ?
same functionaliy ?
If so, why do we have three utilities for the same functinality. (1 Reply)
Discussion started by: frintocf
1 Replies
10. UNIX for Beginners Questions & Answers
Good afternoon friends.
I wanted to make a query, how to compress several files and leave them all in 1, for example
flat text files:
filename_1.csv
filename_2.csv
filename_3.csv
expected result
filename_end.gzip = (filename_1.csv
filename_2.csv
filename_3.csv)
please (2 Replies)
Discussion started by: tricampeon81
2 Replies
GZNEW(1) General Commands Manual GZNEW(1)
NAME
gznew - recompress .Z files to .gz files
SYNOPSIS
gznew [ -ftv9PK] [ name.Z ... ]
DESCRIPTION
gznew recompresses files from .Z (compress) format to .gz (gzip) format. If you want to recompress a file already in gzip format, rename
the file to force a .Z extension then apply gznew.
OPTIONS
-f Force recompression from .Z to .gz format even if a .gz file already exists.
-t Tests the new files before deleting originals.
-v Verbose. Display the name and percentage reduction for each file compressed.
-9 Use the slowest compression method (optimal compression).
-P Use pipes for the conversion to reduce disk space usage.
-K Keep a .Z file when it is smaller than the .gz file
SEE ALSO
gzip(1), gzmore(1), gzdiff(1), gzgrep(1), gzforce(1), gzexe(1), compress(1)
BUGS
gznew does not maintain the time stamp with the -P option if cpmod(1) is not available and touch(1) does not support the -r option.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgzip |
+--------------------+-----------------+
|Interface Stability | External |
+--------------------+-----------------+
NOTES
Source for gzip is available in the SUNWgzipS package.
GZNEW(1)