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

What is difference between bash and shell?

564


What are the advantages of shell scripting?

592


What language is bash?

498


What is subshell?

534


Is powershell a bash?

594






madhar chod unix ke 10 commands dhang se likh nahi sakta hai

2986


Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

1862


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

578


Why do we use shell scripting?

557


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

762


What is eval in shell script?

655


How do I open the shell prompt?

584


What is bash shell command?

564


How to print the first array element?

565


What is path in shell script?

643