Removed /usr/local from CDPATH
[clearscm.git] / functions / logs
1 #!/bin/ksh
2 ################################################################################
3 #
4 # File:         logs
5 # Description:  Functions for handling log files
6 # Author:       Andrew@DeFaria.com
7 # Created:      Thu Dec  9 10:05:09 PST 1999
8 # Modified:
9 # Language:     Korn Shell
10 #
11 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
12 #
13 ################################################################################
14 function roll_log {
15   # roll_log: This function will roll a logfile
16   #
17   # Arguments:
18   #       $1      Directory for log file
19   #       $2      Name of log file
20   #       $3      Name of backup log file
21   #       $4      What activity is being logged
22   logdir=$1
23   logfile=$dir/$2
24   backup_logfile=$dir/$3
25   what=$4
26
27   if [ -f "$logfile" ]; then
28     cat $logfile >> $backup_logfile
29     print "$what log ($(hostname)) started on $(date)" > $logfile
30   fi
31 } # roll_log