PIKT

Samples: Core File Deletion

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch


In this example, we automatically and routinely delete core files on data disks.

The DeleteCoreFiles script just operates silently (although every file removal command is logged in the Notice.log file).

DeleteCoreFiles makes reference to the =dirsuser_obj macro, which resolves to the name of the DirsUser.obj file.  The script follows.

///////////////////////////////////////////////////////////////////////////////
//
// disks_alarms.cfg
//
///////////////////////////////////////////////////////////////////////////////

[other alarms omitted...]

///////////////////////////////////////////////////////////////////////////////

DeleteCoreFiles

        init
                status active
                level notice
                task "Automatically delete core files on data disks"
                input file "=dirsuser_obj"
                dat $filesystem 1

        rule
                =exec "=find $filesystem -type f -name core -exec =lld {} \\;
                             >> =notice_log -exec =rm {} \\; 2>/dev/null"

///////////////////////////////////////////////////////////////////////////////

[other alarms omitted...]

///////////////////////////////////////////////////////////////////////////////

[For more examples, see Samples.]

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

Sams Teach Yourself SuSE Linux in 24 Hours Starter Kit
Sams Teach Yourself SuSE Linux in 24 Hours Starter Kit

Red Hat Linux Bible: Fedora and Enterprise Edition
Red Hat Linux Bible: Fedora and Enterprise Edition

UNIX CD Bookshelf
UNIX CD Bookshelf

Managing Linux Systems with Webmin
Managing Linux Systems with Webmin

Red Hat Enterprise Linux 4 For Dummies
Red Hat Enterprise Linux 4 For Dummies