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 / vipul dalwala

while true
do
THIRDFILE=`ls -t | sed -n '3p'`
find . -name '*.arc' ! -newer ${THIRDFILE} -exec gzip {}
\;
sleep 300
done

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you copy a file from one machine to other?

554


I want to connect to a remote server and execute some commands, how can I achieve this?

585


What is a shell made of?

567


What are the types of script?

623


What language is shell scripting?

586






how to get part of string variable with echo command only?

601


How do you create a shortcut in linux?

603


Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?

1722


What is the difference between bash and shell?

657


What is shell and shell script?

565


How do I run a bin bash script?

582


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1689


Is shell scripting useful?

604


What is the way to do multilevel if-else's in shell scripting?

668


What is the significance of the shebang line in shell scripting?

545