Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi,
i want to zip the files that generates automatically
every few minutes (files generated are in .arc
extension)....any body write a script for this...
thanks in advance

Answer Posted / srinivas

Assuming the *.arc files are getting generated under every
5 minutes..

Create script.sh and cut paste the following contents
--------------------------
while true
do
for i in `ls *.arc` ;
do
ls *.arc 2> /dev/null
if [ $? -eq 0 ]
then
gzip $i
else
echo "No files to be zipped at this moment...Exiting"
exit 1
done
sleep 300
done
--------------------------

Hope this helps

-- Srini

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the exit command?

963


What is a shell script? Can you name some of its advantages?

1040


What is a scripting language simple definition?

1076


What is the difference between bash and shell?

1104


What is the purpose of scripting?

1062


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

983


Where is bash history?

905


How to pass an argument to a script?

1174


What is awk in shell script?

1218


What are script files?

1018


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

1492


‎What is a shell? · ‎Types of shell · ‎what is shell scripting?

966


What does $1 mean in bash?

1073


How to debug the problems encountered in the shell script/program?

1120


Explore about environment variables?

1026