Cfengine: Cleaning Out Scratch Space
From GridPP Wiki
This is a standalone file that can be included with a simple import statement. At Manchester we have 20G scratch spaces, and some experiments require 4GB
######################################################################
#
# cf.scratch - Check and cleanup the scratch directories
#
# threshold - if there's less space than this, we define the class, start clearing and alert
# keep - numnber of days we want to keep.
#
######################################################################
control:
threshhold = ( 21 )
keep = ( 7 )
AddInstallable = ( scratch_needs_cleaning scratch_tidied )
actionsequence = ( disks tidy )
disks:
/scratch freespace=${threshhold}% inform=true force=true define=scratch_needs_cleaning
tidy:
scratch_needs_cleaning::
/scratch
pattern=*
recurse=inf
age=${keep}
rmdirs=true
define=scratch_tidied
alerts:
scratch_tidied::
"Files Deleted from /scratch"