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
Is shell scripting a language?
How do I run a bin bash script?
Give some situations where typing error can destroy a program?
How will you copy a file from one machine to other?
What is a boot block?
How will you print the login names of all users on a system?
What is basename in shell script?
Write a shell script to get current date, time, user name and current working directory.
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
How can the contents of a file inside jar be read without extracting in a shell script?
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?
What are the types of script?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
What is the use of "$?" Sign in shell script?
How to print all array elements and their respective indexes?