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
How do I set bash as default shell mac?
Why are shell scripts used?
Write the syntax for "if" conditionals in linux?
What does .sh file contain?
What is the significance of the shebang line in shell scripting?
What are the two files of crontab command?
What is in a script?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
How does ls command work?
Is shell scripting a programming language?
How do you find out What is your shell?
What are the advantages of shell script?
What are the four fundamental components of every file system on linux?
What is shift command in shell script?
What are script files?