uudemon.cleanup revision 7c478bd95313f5f23a4c958a745db2134aa03244
0N/A# The contents of this file are subject to the terms of the 0N/A# Common Development and Distribution License, Version 1.0 only 0N/A# (the "License"). You may not use this file except in compliance 0N/A# See the License for the specific language governing permissions 0N/A# and limitations under the License. 0N/A# When distributing Covered Code, include this CDDL HEADER in each 0N/A# If applicable, add the following below this CDDL HEADER, with the 0N/A# fields enclosed by brackets "[]" replaced with your own identifying 0N/A# information: Portions Copyright [yyyy] [name of copyright owner] 0N/A# Copyright 1997 Sun Microsystems, Inc. All rights reserved. 0N/A# Use is subject to license terms. 0N/A#ident "%Z%%M% %I% %E% SMI" 0N/A# This demon cleans up uucp directories. 0N/A# it can be run daily, weekly, whatever depending on the system if [ "$1" = "peer_system_name" ]; then # run through the systems list, deleting ppp systems # if any names are in $outstr, assume uucp is configured # Start of actual processing. For energystar compatibility, # we attempt to do as little I/O as possible, so first check # to see if uucp is configured before doing all this work. # Running as uucp, take care to protect things # These are taken from the Makefile. If changed in Makefile # they must be changed here also. # OLD is the directory for archiving old admin/log files # If performance log exists, save it and create a new one # The list in the for controls how many old Log and security logs # are retained: 2 -> 3, 1 -> 2, current -> 1. # Combine all log files into O_LOGS-1. # Add a name separator between each system. # can't compare exactly because of symlinks echo "********** $j ********** ($i)" >> ${
O_LOGS}-
1 # If the accounting log exists, save it and create a new one. # The list in the for controls how many old accounting logs # are retained: 2 -> 3, 1 -> 2, current -> 1. # Execute the system directory cleanup program # See uucleanup.1m for details. # Use the grep instead of the mv to ignore warnings to uucp # cleanup funny directories that may have been created in the spool areas # skip any regular files, like lockfiles # we'd check that we were in the correct directory # Remove subdirs of subdirs # if it is now empty, remove it. # Remove old files and directories #find $PUBDIR -type f -mtime +30 -exec rm -f {} \; # Mail a daily summary of status awk '/(DENIED)/ {print prev} (echo "Subject: uucp Admin"; \ # don't run if no system directories exist # Dispose of mail to nuucp