DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦dffb92741⟧ TextFile

    Length: 2533 (0x9e5)
    Types: TextFile
    Notes: UNIX file
    Names: »housekeeping«

Derivation

└─⟦6279acb2c⟧ Bits:30004169/disk8.imd Uniplex II+ V.6 release 1.0 (dansk)
└─⟦6279acb2c⟧ UNIX Filesystem
    └─⟦this⟧ »up/new/usr/UAP/cmds/housekeeping« 

TextFile


: '
housekeeping - standard UNIPLEX housekeeping operations

L..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T.R.
'
USAGE='
Usage: housekeeping [-bulletin NN] [-trash NN] [-q] [-v]
   or: housekeeping [-V]

where:

-bulletin NN   specifies that the bulletin board is to be cleared if
               it has not been modified in the last NN days
-trash NN      specifies that all trash files older than NN days are
               to be removed.

-q             "quiet" operation. No processing messages displayed
               (other than for errors)
-v             "verbose" operation.

Notes:
a) This program can be invoked from menus, or by cron. It must have
   the "Uniplex" token set and the invoker should be "root" (UID=0)
'

case "$*" in
  -V) exec echo "$0: Vs. 6.00";;
esac

test -z "$Uniplex" && exec echo "$0: No \"Uniplex\" token set$USAGE"

: Argument scan/validation

TRASH=
BULLETIN=
VERBOSE=
ECHO=echo
while : ; do
   case $# in
      0) break;;
   esac
   BADQUAL="$0: Invalid qualifier, \"$2\", following \"$1\""
   case "$1" in
    -trash) case "$2" in
               [1-9]|[1-9][0-9]|[1-9][0-9][0-9]) ;;
               *) exec echo "$BADQUAL$USAAGE";;
            esac
            TRASH=$2
            shift
            ;;
    -bulletin)
            case "$2" in
               [1-9]|[1-9][0-9]|[1-9][0-9][0-9]) ;;
               *) exec echo "$BADQUAL$USAAGE";;
            esac
            BULLETIN=$2
            shift
            ;;
        -q) ECHO=:
            ;;
        -v) ECHO=echo
            VERBOSE=Y
            ;;
         *) echo "$0: WARNING: Ignoring unexpected argument, \"$1\""
            ;;
   esac
   shift
done

: Now do processing required

case "$BULLETIN" in
[1-9]*)
   F=$Uniplex/.Bulletins
   $ECHO "Erasing $F if it is more than $BULLETIN days old"
   find $F -mtime +$BULLETIN -exec rm -f {} \;
   case "$VERBOSE" in
      Y) test -f $F || echo "$F no longer exists!";;
   esac
esac

case "$TRASH" in
[1-9]*)
   DIR=`sed -n "s/^TRASH='\(.*\)' *$/\1/p" $Uniplex/uniplex.sys`
   if test -z "$DIR"; then
      echo "Can't find TRASH directory. Ignoring -trash request"
   elif ( cd $DIR ) >/dev/null 2>&1; then
      $ECHO "Erasing all files in $DIR that are more than $TRASH days old"
      find $DIR -type f -mtime +$TRASH -print |
      while read F; do
         case "$VERBOSE" in
            Y) echo "Removing $F";;
         esac
         rm -f $F
      done
   else
      echo "Can't find TRASH directory ($DIR). Ignoring -trash request"
   fi
esac