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

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.

2176


How do I edit a .sh file?

624


Write the syntax for "if" conditionals in linux?

597


Is bash a shell script?

604


What is the meaning of $1 in shell script?

594






Explain about stdin, stdout and stderr?

635


What is scripting used for?

564


Suppose you execute a command using exec, what will be the status of your current process in the shell?

581


How do I run a powershell script?

576


How to print all array elements and their respective indexes?

510


Write a command sequence to find the count of each word?

542


How do you debug a script?

567


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?

638


What is the default shell of solaris?

575


How to print all the arguments provided to the script?

557