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

Is shell scripting a language?

977


How do I run a bin bash script?

970


Give some situations where typing error can destroy a program?

1181


How will you copy a file from one machine to other?

944


What is a boot block?

961


How will you print the login names of all users on a system?

915


What is basename in shell script?

1009


Write a shell script to get current date, time, user name and current working directory.

1028


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

1069


How can the contents of a file inside jar be read without extracting in a shell script?

1079


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?

1053


What are the types of script?

1089


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

929


What is the use of "$?" Sign in shell script?

1093


How to print all array elements and their respective indexes?

900