Networker

[Networker] Purging an old clients CFI

2012-11-14 18:58:45
Subject: [Networker] Purging an old clients CFI
From: bbartick <networker-forum AT BACKUPCENTRAL DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Wed, 14 Nov 2012 15:57:57 -0800
If the client resource is already deleted as the original poster reported, I 
don't think Networker will ever clean up the index entries. Hence, the need for 
some type of manual script like this one. Edit/modify as you see fit. We keep 
our indexes spread out on different filesystems.
Uncomment the (2) lines to actually delete the index entries. I tend to just 
run the script and manually verify than delete them.


#!/bin/sh
#
# 1.0
# NAME: chk_need_index
# Check and clean up index files
#
# Parameters: none
# Return Codes
#
# Brett Bartick
# Nomura Securities
# Thu Nov  8 16:15:39 EST 2007
#

PATH=/usr/bin:/opt/sa/bin; export PATH

# setup the environment variables
DAYS=45
FNAME=`basename $0`
INDEX=/index01/index
#INDEX=/index02/index
#INDEX=/networker/nsr/index


cd $INDEX
for i in `ls -d *`
do
        client="`basename $i`"
        file_name=${INDEX}/$client
        file_age=`perl -e 'print int((-M $ARGV[0]))' ${file_name}/db6`

        if [ $file_age -gt $DAYS ]; then
                ls -ld ${file_name}/db6
##              echo "rm -rf $file_name"
##              rm -rf $file_name
        fi
done
exit

+----------------------------------------------------------------------
|This was sent by bbartick AT us.nomura DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>
  • [Networker] Purging an old clients CFI, bbartick <=