zipping a directory when the file count is over $X
Hiya,
I've been plugging away at this script and I cant get it to behave as I need.
first off it fails to adhere to the conditions of the file limit, and zips the directory regardless of the file count and secondly, but less important it zips up the entire path not just the directory I'm after.
How do I count number of file in a directory. Here is what I want to do.
1. find total number of file in a directory in variable total
2. ftp all the file
3. ftp_return_code=`grep -c "Transfer complete" $logfile`
if
then
exit 0
else
exit -1
fi (6 Replies)
Hi,
i have more than 300 tar files in directory and i want to zip all tar files to single file.
could anybody tell me the command since i know how to do zip for single tar file:
bash-3.00$gzip 2008_11_10.tar
bash-3.00$ pwd
/oracle1/archivebackup
in this directory i have lot files... (2 Replies)
hello there
i want to creat a file that count how many files i have in the directory.
for this i use the command
find . -type f | wc -l > 1In1.myfile
the problem with this command is that it not update after i add a new file in the directory.
Anyone got any ideas how i can... (5 Replies)
Hi,
I am having some problem with a shell script which zip some files. For zipping I have used the following command:
find . -name "Test_*" -mtime 0 | zip Test_$(date +"%Y%m%d") -@
I have kept the script in /home/abc directory. It is creating the zip file within the same directory where i... (2 Replies)
Hello everyone,
I am trying to make a script in KSH that will zip an entire directory but leave out one file in that directory. I then need to send that zipped directory to another UNIX box. I am new to UNIX and would appreciate a good template to study from. (3 Replies)
Hello,
I have some files and i want to count how many times a string is appeared in each file.
Lets say :
#cat fileA
stringA
sdh
stringB
stringA
#cat fileB
stringB
stringA
sdb
stringB
stringB
I need the output to be something like: (2 Replies)
Hi Folks,
I have a directory in unix that is /usr/local/pos contain the folowing directoreis ..that is
dir1
dir2
dir3
now I want to delete only dir2 please advise how to remove the directory dir 2 ..that is rm command and how to use it , and second if I want to zip the dir3 please... (1 Reply)
Hi Folks,
I have logs at the following location
cd /out/app/logs/
now that logs directory contain different types of logs now sometimes i need to
do disk clean up activity so i need to zipped the logs can you please advise
any command by which all the logs created in this directory are... (2 Replies)
Hi ,
I want to zip files present in the directories listed under a parent directory without zipping the directory itself
my parent directory path is
/informatica/DGDMN/PowerCenter1011/server/infa_shared/SrcFiles/OTE/Final_Directory
I have the below directories named as 1,2,3,4,5 listed... (9 Replies)
Hi All ,
We need one help on the below requirement.We have multiple pipe delimited .txt file(around 100 .txt files) present on one directory.We need the total record count of all the files present in that directory without header.File format as below :
... (8 Replies)
Discussion started by: STCET22
8 Replies
LEARN ABOUT CENTOS
advzip
AdvanceCOMP ZIP Compression Utility(1) General Commands Manual AdvanceCOMP ZIP Compression Utility(1)NAME
advzip - AdvanceCOMP ZIP Compression Utility
SYNOPSIS
advzip [-a, --add] [-x, --extract] [-l, --list]
[-z, --recompress] [-t, --test] [-0, --shrink-store]
[-1, --shrink-fast] [-2, --shrink-normal] [-3, --shrink-extra]
[-4, --shrink-insane] [-N, --not-zip] [-p, --pedantic] [-q, --quiet]
[-h, --help] [-V, --version] ARCHIVES... [FILES...]
DESCRIPTION
The main purpose of this utility is to recompress and test the zip archives to get the smallest possible size.
For recompression the 7-Zip (www.7-zip.com) Deflate implementation is used. This implementation generally gives 5-10% more compression than
the zLib Deflate implementation.
For experimental purpose also the 7-Zip LZMA algorithm is available with the -N option. In this case, the generated zips WILL NOT BE USABLE
by any other program. To make them usable you need to recompress them without the -N option. Generally this algorithm gives 10-20% more
compression than the 7-Zip Deflate implementation.
OPTIONS -a, --add ARCHIVE FILES...
Create the specified archive with the specified files. You must specify only one archive.
-x, --extract ARCHIVE
Extract all the files on the specified archive. You must specify only one archive.
-l, --list ARCHIVES...
List the content of the specified archives.
-z, --recompress ARCHIVES...
Recompress the specified archives. If the -1, -2, -3 options are specified, it's used the smallest file choice from: the previous
compressed data, the new compression and the uncompressed format. If the -0 option is specified the archive is always rewritten
without any compression.
-t, --test ARCHIVES...
Test the specified archives. The tests may be extended with the -p option.
-N, --not-zip
Use the LZMA algorithm when compressing. The generated zips will not be readable by any other application!
-p, --pedantic
Be pedantic on the zip tests. If this flag is enabled some more extensive tests on the zip integrity are done. These tests are gen-
erally not done by other zip utilities.
-0, --shrink-store
Disable the compression. The file is only stored and not compressed. This option is very useful to expand the archives of .png and
.mp3 files. These files are already compressed, trying to compress them another time is really a waste of time and resource.
-1, --shrink-fast
Set the compression level to "fast".
-2, --shrink-normal
Set the compression level to "normal". This is the default level of compression.
-3, --shrink-extra
Set the compression level to "extra".
-4, --shrink-insane
Set the compression level to "insane".
COPYRIGHT
This file is Copyright (C) 2002 Andrea Mazzoleni, Filipe Estima
SEE ALSO advpng(1), advmng(1), advdef(1)
AdvanceCOMP ZIP Compression Utility(1)