Kiss Gabor (Bitman) schrieb: > Hi Christoph, > >>> I think these lines >>> cd $dir >>> db4.6_archive | xargs --no-run-if-empty rm -f > (1) >>> cd - >>> might be replaced with >>> db4.6_archive -h $dir -d > (2) >> -d is not what you want. It removes the logfiles which can be deleted >> after backing them up. What we want is to remove empty files. So your > > Oh I see. I though that "no longer in use" and "no longer needed" are > equivalent. Thanks for the clarification. :-) > >> line would be equivalent to: >> >> db4.6_archive | xargs rm -f > (3) >> The correct replacement I think is >> >> db4.6_archive -h $dir | xargs --no-run-if-empty rm -f > (4) > > Are you sure???? > I think commands (3) and (4) do the same in essence. > The only differences are that (3) processes the current dir > (what is definitely differs from (2)) > and in (3) xargs starts rm even its if standard input is empty. > But db4.6_archive do the same thing in (3) and (4): it prints some > filenames of the given directory. > > I guess (4) is equalt to (2). > Anyway I've changed my cron job to use (4).
You are right and I am wrong. Your version is correct. I thought we
would remove emptied logfiles, but we want to remove all the logfiles
which get printed bei db_archive. So (2) is correct.
Christoph
--
============================================================================
Christoph Martin, Leiter der EDV der Verwaltung, Uni-Mainz, Germany
Internet-Mail: [EMAIL PROTECTED]
Telefon: +49-6131-3926337
Fax: +49-6131-3922856
signature.asc
Description: OpenPGP digital signature

