|
On Fri, 2004-05-28 at 10:35, Marco Facchinetti wrote: > But how to delete all the directories in /tmp/test without > deleting test? > > The problem is with Infoprint server (no exit pgm), the > risult is: > /Pdf <-- Pdf home dir > /Pdf/B000000123 <-- Job dir > /Pdf/B000000123/User <-- User dir > /Pdf/B000000123/User/File1.pdf <-- Usable pdf > /Pdf/B000000123/User/File2.pdf <-- Usable pdf > /Pdf/B000006666 <-- Job dir > /Pdf/B000006666/User <-- User dir > /Pdf/B000006666/User/File1.pdf <-- Usable pdf > /Pdf/B000006666/User/File2.pdf <-- Usable pdf > > when I try to delete Bnnnnnnnnn I've got a CPFA0AC, if I > delete all the object starting from the bottom it's working > but.... Marco QSH CMD('rm -rf /Pdf/*') will remove all files *and* directories below /Pdf/ but will *leave* /Pdf/ in place. QSH CMD(rm -rf /Pdf') would remove /Pdf and everything below it. Using James's example, you use QSH CMD('rm -r test/*') to get rid of files below test, leaving test alone. By default the rm command only removes files, not directories. Also deleting a directory that isn't empty generates errors (as your CPFA0AC above). Using the -f (force) option (as 'rm -r -f' or combined as 'rm -rf') will force directories to be deleted along with files. I have housekeeping routines that keep directories like this tidied up, but leaving the most recent files alone: QSH CMD('find /pdfs -atime +8 -print | xargs rm -rf') which lists all files below /pdfs that haven't been accessed in the last 8 days and deletes them. There was a discussion on this technique on the list a few days ago, which give a few more examples. Regards, Martin -- martin@xxxxxxxxxx AIM/Gaim: DBG400dotNet http://www.dbg400.net /"\ DBG/400 - DataBase Generation utilities - AS/400 / iSeries Open \ / Source free test environment tools and others (file/spool/misc) X [this space for hire] ASCII Ribbon Campaign against HTML mail & news / \
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.