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

How do I run a shell script in powershell?

1123


What is a shell made of?

957


What is @echo off?

1010


What does $@ mean in shell?

1039


What lives in a shell?

962


What is echo $shell?

1090


Why are shell scripts used?

1077


What are zombie processes?

1025


How to get the 3rd element/column from each line from a file?

1189


What are different types of shell?

928


How to get the last line from a file using just the terminal?

1227


How to set an array in linux?

1221


What is awk in shell script?

1228


How are shells born?

968


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

4127