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
Explain about the exit command?
What is a shell script? Can you name some of its advantages?
What is a scripting language simple definition?
What is the difference between bash and shell?
What is the purpose of scripting?
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
Where is bash history?
How to pass an argument to a script?
What is awk in shell script?
What are script files?
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
What is a shell? · Types of shell · what is shell scripting?
What does $1 mean in bash?
How to debug the problems encountered in the shell script/program?
Explore about environment variables?