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
What is difference between bash and shell?
What are the advantages of shell scripting?
What language is bash?
What is subshell?
Is powershell a bash?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
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.
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
Why do we use shell scripting?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
What is eval in shell script?
How do I open the shell prompt?
What is bash shell command?
How to print the first array element?
What is path in shell script?