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
Can shell script run on windows?
How do I edit a .sh file?
How do I save a powershell script?
What shell is bin sh?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?
How do I set bash as default shell mac?
How to find duplicate record in file using shell script?
How do I run a .sh file on mac?
What does $@ mean in shell?
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?
How do I open the shell prompt?
How do you create a shortcut in linux?
What are the default permissions of a file when it is created?
What is a shell made of?