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

Can shell script run on windows?

1123


How do I edit a .sh file?

1211


How do I save a powershell script?

1217


What shell is bin sh?

1018


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2521


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

4188


How do I set bash as default shell mac?

1052


How to find duplicate record in file using shell script?

1452


How do I run a .sh file on mac?

1253


What does $@ mean in shell?

1088


How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?

1160


How do I open the shell prompt?

1247


How do you create a shortcut in linux?

1267


What are the default permissions of a file when it is created?

1072


What is a shell made of?

1007