Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Tuesday, June 9, 2009

Intel SQL Modifications For Our NetBackup Backup Reporter Script

Hey There,

Well, I guess it's never to early for an update on a script (most of the times I realize I royally screwed one up occur just minutes after I officially hand it off ;)

Today's update is a follow-up to yesterday's updated NetBackup backup report script for Linux or Unix with Perl. The additions (noted in the comment section at the head of the script) include one user request (support for the Intel SQL module and the Veritas/Symantec required .bch extensioned files) and dusting away a few cobwebs.

Again, if you don't care about the script's output, click here to go straight to the script!

Improvements (I hope ;)

Added:
Support For Intel SQL and OS backups
Reporting of .bch Intel SQL script execution
Explicit close on MAIL file descriptor
Explicit return to STDOUT file descriptor before exit
Minimal signal handling to remove temp file
A bit more error checking and handling

Changed:
Job parsing rule to make exceptiong for .bch files

Modified:
Rule to determine job reporting eligibility

Downsides Noted So Far:
The script now takes about a second and a half to execute on the same system.
I still don't know if it works for everything :)

-------------

Here's some updated output, that you should expect to see (except for the errors, hopefully... ;) Again, you can skip straight to the script by clicking here!



ERROR FREE REPORT - 24 HOUR TIME SPAN - TRUNCATED WITH ELLIPSES...


-------------------
NetBackup Status Report
-----------------------------------------------
Report Span = 06/07/09 ¦ 17:31:47 through 06/08/09 ¦ 17:31:47
-----------------------------------------------


Jobs Completed Successfully!

***************************************************

Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - File List
***************************************************

host123 ¦ Database_Backup ¦ Default-Application-Backup ¦ 25847840 kb ¦ 14.57 min ¦ 06/07/09 ¦ 22:00:37 ¦ 06/07/09 ¦ 22:15:11
/lafjaiefal_1
***************************************************
host123 ¦ Database_Backup ¦ Default-Application-Backup ¦ 387360 kb ¦ 1.85 min ¦ 06/07/09 ¦ 22:17:10 ¦ 06/07/09 ¦ 22:19:01
/eiwoujlsdjf_1
...
***************************************************
host123-v ¦ NBU ¦ Catalog Backup ¦ 56096 kb ¦ 0.13 min ¦ 06/08/09 ¦ 01:08:52 ¦ 06/08/09 ¦ 01:09:00
***************************************************
host123-v ¦ NBU ¦ Catalog Backup ¦ 56864 kb ¦ 0.13 min ¦ 06/07/09 ¦ 22:23:15 ¦ 06/07/09 ¦ 22:23:23
***************************************************
host123-v ¦ NBU ¦ Catalog Backup ¦ 58400 kb ¦ 0.13 min ¦ 06/07/09 ¦ 19:46:09 ¦ 06/07/09 ¦ 19:46:17
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/07/09 ¦ 22:23:25 ¦ 06/07/09 ¦ 22:23:26
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/08/09 ¦ 01:09:01 ¦ 06/08/09 ¦ 01:09:02
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.02 min ¦ 06/08/09 ¦ 13:09:02 ¦ 06/08/09 ¦ 13:09:03
***************************************************
host123-v ¦ NBU ¦ image catalog cleanup ¦ 0 kb ¦ 0.03 min ¦ 06/07/09 ¦ 19:46:18 ¦ 06/07/09 ¦ 19:46:20
***************************************************
intelsql1 ¦ INTEL_SQL ¦ Default-Application-Backup ¦ 4832 kb ¦ 0.55 min ¦ 06/07/09 ¦ 19:39:18 ¦ 06/07/09 ¦ 19:39:51
/MEMMISOIE.MSSQL7.DIKKEISKK\\EKKKDISS.db.model.~.7.001of001.20090607203913..C
...
***************************************************
intelsql1 ¦ INTEL_SQL ¦ FULL ¦ 0 kb ¦ 11.18 min ¦ 06/07/09 ¦ 19:30:00 ¦ 06/07/09 ¦ 19:41:11
nbu_sql_script.bch
***************************************************
intelsql1 ¦ INTEL_OS ¦ DAILY ¦ 1607132 kb ¦ 5.18 min ¦ 06/07/09 ¦ 19:30:00 ¦ 06/07/09 ¦ 19:35:11
ALL_LOCAL_DRIVES
***************************************************
intelsql2 ¦ INTEL_OS ¦ DAILY ¦ 2163310 kb ¦ 16.18 min ¦ 06/07/09 ¦ 19:30:00 ¦ 06/07/09 ¦ 19:46:11
ALL_LOCAL_DRIVES
***************************************************

-----------------------------------------------



REPORT WITH ERRORS IN IT - 48 HOUR TIME SPAN - TRUNCATED WITH ELLIPSES...


NetBackup Status Report
-----------------------------------------------
Report Span = 06/06/09 ¦ 17:51:26 through 06/08/09 ¦ 17:51:26
-----------------------------------------------

Jobs With Errors To Report!

***************************************************
Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - Error - File List
***************************************************

host456 ¦ Database_Backup ¦ warm_back ¦ 0 kb ¦ 13.90 min ¦ 06/06/09 ¦ 23:24:02 ¦ 06/06/09 ¦ 23:37:56
ERROR: the backup failed to back up the requested files!!!
/usr/local/bin/warm_backup.sh
***************************************************
host456 ¦ Database_Backup ¦ warm_back ¦ 0 kb ¦ 15.28 min ¦ 06/07/09 ¦ 23:24:09 ¦ 06/07/09 ¦ 23:39:26
ERROR: the backup failed to back up the requested files!!!
/usr/local/bin/warm_backup.sh
***************************************************

-----------------------------------------------

Jobs Completed Successfully!

***************************************************

Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - File List
***************************************************

host456 ¦ Database_Backup ¦ Default-Application-Backup ¦ 12589911 kb ¦ 10.77 min ¦ 06/06/09 ¦ 23:00:20 ¦ 06/06/09 ¦ 23:11:06
/fsladfjf_1_1
***************************************************
host456 ¦ Database_Backup ¦ Default-Application-Backup ¦ 12589911 kb ¦ 10.87 min ¦ 06/07/09 ¦ 23:00:14 ¦ 06/07/09 ¦ 23:11:06
/fajlfasljf_1_1
***************************************************
...
SEE ABOVE :)
***************************************************

-----------------------------------------------





Creative Commons License
bpreport.pl by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at linuxshellaccount.blogspot.com.
Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com


#!/usr/bin/perl
#
# bpreport.pl - 2009 Mike Golvach - eggi@comcast.net
#
#bpreport.pl by Mike Golvach is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. Based on a work at linuxshellaccount.blogspot.com. Permissions beyond the scope of this license may be available at http://linuxshellaccount.blogspot.com.
#
# 06/08/09:
# Added: Support For Intel SQL And OS backups
# Added: Reporting of 0kb .bch Intel SQL script execution
# Added: Explicit close on MAIL file descriptor
# Added: Explicit return to STDOUT file descriptor before exit
# Added: Minimal signal handling to remove temp file
# Added: A bit more error checking and handling
# Modified: Job parsing rule to make exceptiong for .bch files
# Modified: Rule to determine job reporting eligibility
#

$SIG{INT} = \&bail;

$first_tmp = $$;
$offset = $ARGV[0];

if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}

if ( $#ARGV != 0 ) {
print "Usage: $0 TimeInSecondsToReportBack\n";
exit(1)
}

$sisosig = system("/usr/openv/netbackup/bin/admincmd/bpdbjobs -all_columns >>tmp.$first_tmp");

if ( $sisosig > 0 ) {
bail();
}

open(FT, "<tmp.$first_tmp");
@all_jobs = <FT>;
close(FT);

if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}

$global_error_flag = 0;
$separator = "***************************************************";
$hostname=`hostname`;

foreach $job (@all_jobs) {
@file_list="";
@job = split(/,/, $job);
chomp($job[14]);
if ( $job[14] =~ /^$/ ) {
$job[14] = "0";
}
$error_flag = 0;
$report_time = $job[8];
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($job[8]);
$today = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($job[10]);
chomp($today_end = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday));
if ( $today_end =~ /12\/31\/69/ ) {
$today_end = "JOB IN PROGRESS";
}
$today_span_pre = ( $job[9] / 60 );
$today_span = sprintf("%.2f min", $today_span_pre);
$actual_time = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$right_now = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time-$offset);
$back_then = parse_date($sec,$min,$hour,$mday,$mon,$year,$wday);
report_span($report_time, $actual_time, $offset);
next if $dont_report;
if ( $job[3] > 1 ) {
@error_condition = `/usr/openv/netbackup/bin/admincmd/bperror -S $job[3]`;
chomp($error_condition = $error_condition[0]);
$job[3] = $error_condition;
$error_flag = 1;
$global_error_flag = 1;
}
### next if ( $job[6] eq "backuphost" && $job[14] == 0 && ! $error_flag );
next if ( $job[6] eq "backuphost" && ! $error_flag );
$job[$file_list] = $job[31] if ( $job[4] =~ /Intel_SQL/ && $job[5] =~ /FULL/ );
$file_list=32;
$file_list_still_going = 1;
$just_starting = 1;
while ($file_list_still_going) {
if ( ( $job[$file_list] =~ /(\/¦\\¦ALL)/ ) ¦¦ ( $job[4] =~ /Intel_SQL/ & $job[$file_list] =~ /\.bch/ ) ) {
if ( $just_starting ) {
push(@file_list, "$job[$file_list] ");
$file_list++;
$just_starting = 0;
} else {
push(@file_list, "¦ $job[$file_list] ");
$file_list++;
}
} else {
$file_list_still_going = 0;
}
}
if ( ! $job[5] && ! $job[6] ) {
if ( $job[42] =~ /^.*(image catalog cleanup).*$/ ) {
$job[6] = $job[25];
$job[5] = $job[42];
$job[5] =~ s/^.*(image catalog cleanup).*$/$1/;
$job[4] = "NBU";
} else {
$job[5] = "Server UNKNOWN";
$job[4] = "NBU";
}
} elsif ( ! $job[5] && $job[6] ) {
if ( $job[42] =~ /^.*(Catalog Backup).*$/ ) {
$job[6] = $job[25];
$job[5] = $job[42];
$job[5] =~ s/^.*(Catalog Backup).*$/$1/;
$job[4] = "NBU";
} else {
$job[5] = "Policy UNKNOWN";
$job[4] = "NBU";
}
}
if ( $#file_list == 0 ) {
push(@job_successes, "$job[6] ¦ $job[4] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\n$separator\n");
} elsif ( $error_flag ) {
push(@job_errors, "$job[6] ¦ $job[4] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\nERROR: ${error_condition}!!!\n@{file_list}\n$separator\n");
} else {
push(@job_successes, "$job[6] ¦ $job[4] ¦ $job[5] ¦ $job[14] kb ¦ $today_span ¦ $today ¦ $today_end\n@file_list\n$separator\n");
}
}

$¦=1;

## Don't send out okay mails if everything is fine)
#if ( @job_errors ) {

open(MAIL, "¦/usr/lib/sendmail -t");
select(MAIL);
if ( ( $#job_errors < 0 )&& ( $#job_successes < 0 ) ) {
print "Subject: NO JOBS: $hostname NetBackup Status Report - $right_now\n";
} elsif ( @job_errors ) {
print "Subject: ERRORS: $hostname NetBackup Status Report - $right_now\n";
} else {
print "Subject: ALL OK: $hostname NetBackup Status Report - $right_now\n";
}
print "From: them\@xyz.com\n";
print "Reply-To: us\@xyz.com\n";
print "To: us\@xyz.com\n";
print "\n\n";
print "NetBackup Status Report\n";
print "-----------------------------------------------\n";
print "Report Span = $back_then through $right_now\n";
print "-----------------------------------------------\n";
print "\n";
if ( ( $#job_errors < 0 )&& ( $#job_successes < 0 ) ) {
print "No Activity To Report! Check If NetBackup Is Running!\n";
print "-----------------------------------------------\n";
} else {
if ( @job_errors ) {
print "Jobs With Errors To Report!\n\n$separator\n";
print "Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - Error - File List\n";
print "$separator\n\n";
@job_errors = sort @job_errors;
$job_error_count = @job_errors;
if ( $job_error_count ) {
print "@job_errors\n";
} else {
print "NO ERRORS TO REPORT. REPORT MAY BE IN ERROR!!!\n\n"
}
print "-----------------------------------------------\n";
}
if ( @job_successes ) {
print "\nJobs Completed Successfully!\n\n$separator\n\n";
print "Server ¦ Policy ¦ Type ¦ Kb ¦ Min Elapsed ¦ Start Date ¦ Time ¦ End Date ¦ Time - File List\n";
print "$separator\n\n";
@job_successes = sort @job_successes;
print "@job_successes\n";
print "-----------------------------------------------\n";
}
}
select(STDOUT);
close(MAIL);
#} # End of possibly-no-mail section
exit(0);

sub parse_date {

my ($sec,$min,$hour,$mday,$mon,$year,$wday) = @_;
%months = qw(0 Jan 1 Feb 2 Mar 3 Apr 4 May 5 Jun 6 Jul 7 Aug 8 Sep 9 Oct 10 Nov 11 Dec);
%weekdays = qw(0 Sun 1 Mon 2 Tue 3 Wed 4 Thu 5 Fri 6 Sat);
if ( $sec < 10 ) {
$sec = "0" . $sec;
}
if ( $min < 10 ) {
$min = "0" . $min;
}
if ( $hour < 10 ) {
$hour = "0" . $hour;
}
if ( $mday < 10 ) {
$mday = "0" . $mday;
}
if ( $yday < 10 ) {
$yday = "0" . $yday;
}
$mon = $mon + 1;
if ( $mon < 10 ) {
$mon = "0" . $mon;
}
$wday = $weekdays{$wday};
$year = 1900 + $year;
$year =~ s/^..(.*)$/$1/;
$nice_date = "${mon}/${mday}/$year ¦ ${hour}:${min}:$sec";
}

sub report_span {

my ($report_time,$actual_time,$offset) = @_;
$dont_report = 0;
$more_than_offset_hours_old = $actual_time - $report_time;
if ( $more_than_offset_hours_old > $offset ) {
$dont_report = 1;
}
}

sub bail {

print "BAILING\n";
if ( -f "tmp.$first_tmp" ) {
unlink("tmp.$first_tmp")
}
exit(2);
}




, Mike




Banner for College Student-Oriented Sites (728 version 1)





Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Saturday, March 29, 2008

Removing Old Users Network Wide Using Expect

Hey there,

Here comes another Expect monster-sized weekend script for you ;)

Today's script is a twist on a previous script we posted to do network wide updates. The essence is still the same. This should basically save you the hassle of having to log in to a million different servers to find and remove users who you know shouldn't have accounts on your boxes.

Again, you can also delete the "Weed out the undesirables pronto" section if you don't want to minimally secure the script from unauthorized usage by doing a logname check.

We've left out the login functionality for Linux this time, but we'll add it tomorrow as a "diff -c" patch file and add it to this file with "patch" to give the week an appropriate finish :)

There's a section I wrote specifically for an Informix sql database, that you can modify (or remove) if you like, to include an example of how to check for users (or anything, really) in a database. If you don't want or need that functionality, just delete the "$userlogin mail server sql user report:" section. All the sections are highlighted with tons of pound signs (#)

Once you edit this Expect script to suit your needs, you can run it easily, like so (with -h if you want to see the help screen):

Ex:
host # ./eraser


or

host # ./eraser -h

See you tomorrow with the Linux additions. Have a great weekend :)


Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License

#!/usr/local/bin/expect

log_user 0

#########################################################################
# eraser - root out ex-employees across network
# 2008 - Mike Golvach - eggi@comcast.net
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#
# Usage: eraser <-h> [User Login] [Your Login]
#########################################################################

#########################################################################
# Weed out the undesirables pronto
#########################################################################

set gauntlet [exec logname]
if { [string compare $gauntlet "user1"] != 0 && [string compare $gauntlet "user2"] != 0 } {
puts "Sorry, $gauntlet. You may not use eraser."
exit
}

#########################################################################
# Go for the help short-circuit
#########################################################################

foreach member $argv {
if { $member == "-h" } {
puts "#############################################################################"
puts "USAGE:"
puts " $argv0 <-h> \[User Login\] \[Your Login\]"
puts "#############################################################################"
puts "SCO Hosts:"
puts " sco1 sco2"
puts "SUN Hosts:"
puts " sun1 sun2"
puts "HP Hosts:"
puts " hp1 hp2"
puts "#############################################################################"
puts "FLAGS:"
puts " -h: Show this message."
puts " User Login: Theirs."
puts " Your Login: Yours."
puts "#############################################################################"
puts "A FEW VALID COMMAND LINE EXPRESSIONS:"
puts " $argv0 -h"
puts " \(The -h command invalidates all others\)"
puts " $argv0 userlogin yourlogin"
puts " \(The Regular Way\)"
puts "#############################################################################"
exit
} elseif { [string match -* $member] == 1 } {
puts "Usage: $argv0 <-h> \[User Login\] \[Your Login\]"
exit
}
}

#########################################################################
# Generic login procs divided by architecture
#########################################################################

proc sun_login {tprompt login lpass} {

set timeout 3
set prompt $tprompt
set qlogin $login
set qpass $lpass

expect "ogin: " {send "$qlogin\r"}
expect "word: " {send "$qpass\r"}
}

proc hp_login {tprompt login lpass} {

set timeout 12
set prompt $tprompt
set qlogin $login
set qpass $lpass

expect "ogin: " {send "$qlogin\r"}
expect "word:" {send "$qpass\r"}
}

proc sco_login {tprompt login lpass} {

set timeout 6
set prompt $tprompt
set qlogin $login
set qpass $lpass

expect "ogin: " {send "$qlogin\r"}
expect "word:" {send "$qpass\r"}
expect -re $tprompt {send "\r"}
}

#########################################################################
# passwd and mail aliases groper procs by architecture
#########################################################################

proc sunhp_q {tprompt login lpass userlogin host} {
set timeout 5
set log $login
set opass $lpass
set prompt $tprompt
set ulogin $userlogin
set hostname $host
set insidealias none
set insidepwd none

send_user "Scanning $hostname... "

expect -re $tprompt {send "grep $ulogin /etc/passwd\r"}
expect -re $tprompt
send "echo $?\r"
expect -re "\r\n(.*)\r\n"
set returnval $expect_out(1,string)
if { $returnval == 0 } {
set insidepwd 1
}
expect -re $tprompt {send "grep $ulogin /etc/mail/aliases\r"}
expect -re $tprompt
send "echo $?\r"
expect -re "\r\n(.*)\r\n"
set returnval $expect_out(1,string)
if { $returnval == 0 } {
set insidealias 1
}
expect -re $tprompt {
send "exit\r"
}
return "$hostname $insidepwd $insidealias"
}

proc sco_q {tprompt login lpass userlogin host} {
set timeout 5
set log $login
set opass $lpass
set prompt $tprompt
set ulogin $userlogin
set hostname $host
set insidealias none
set insidepwd none

send_user "Scanning $hostname... "

expect -re $tprompt {send "\r"}
expect -re $tprompt {send "grep $ulogin /etc/passwd\r"}
expect -re $tprompt
send "echo $?\r"
expect -re "\r\n(.*)\r\n"
set returnval $expect_out(1,string)
if { $returnval == 0 } {
set insidepwd 1
}
expect -re $tprompt {send "grep $ulogin /usr/mmdf/table/alias.user\r"}
expect -re $tprompt
send "echo $?\r"
expect -re "\r\n(.*)\r\n"
set returnval $expect_out(1,string)
if { $returnval == 0 } {
set insidealias 1
}
expect -re $tprompt {
send "exit\r"
}
return "$hostname $insidepwd $insidealias"
}

#########################################################################
# The main process loop
#########################################################################

#########################################################################
# Check command line args
#########################################################################

if { [llength $argv] < 2 } {
puts "Usage: $argv0 <-h> \[User Login\] \[Your Login\]"
exit
}

#########################################################################
# Set list of servers, passwords and other globals
#########################################################################

set sun [list sun1 sun2]
set sco [list sco1 sco2]
set hp [list hp1 hp2]

set userlogin [lindex $argv 0]
set login [lindex $argv 1]
set tprompt "(%|#|\\\/|\\\$|\\\/|\\\/\\\/#|mgolvach|\\\)|\\\>|\\\}) ?$"

#########################################################################
# Grab user password.
#########################################################################

send_user "Enter your login password : "
stty -echo
expect -re "(.*)\n"
stty echo
set lpass $expect_out(1,string)

send_user "\n"

#########################################################################
# Do It To It.
#########################################################################

foreach host $sun {
spawn telnet $host
sun_login $tprompt $login $lpass
lappend finalists [sunhp_q $tprompt $login $lpass $userlogin $host]
}

foreach host $hp {
spawn telnet $host
hp_login $tprompt $login $lpass
lappend finalists [sunhp_q $tprompt $login $lpass $userlogin $host]
}

foreach host $sco {
spawn telnet $host
sco_login $tprompt $login $lpass
lappend finalists [sco_q $tprompt $login $lpass $userlogin $host]
}

puts ""
puts "#################################################################"
puts "$userlogin is a valid user on the following machines:"
puts "#################################################################"
set counter 0
foreach item $finalists {
if { [lindex $item 1] == 1 } {
incr counter
puts [lindex $item 0]
}
}
if { $counter == 0 } {
puts "No valid accounts found for $userlogin"
}
puts "#################################################################"
puts "$userlogin has mail alias entries on the following machines:"
puts "#################################################################"
set counter 0
foreach item $finalists {
if { [lindex $item 2] == 1 } {
incr counter
puts [lindex $item 0]
}
}
if { $counter == 0 } {
puts "No alias file entries found for $userlogin"
}
puts "#################################################################"
puts "$userlogin mail server sql user report:"
puts "#################################################################"
set counter 0
set squealer [open "|isql userdb 2>/dev/null >/tmp/tattle1.tmp" w]
puts $squealer "select * from mail_users where mail_user_id = \"$userlogin\""
close $squealer
set stooly [open "/tmp/tattle1.tmp"]
while {[gets $stooly buffer]!=-1} {
if { [string match *$userlogin* $buffer] == 1 } {
puts "Mail Dir : $buffer"
incr counter
}
}
if { $counter == 0 } {
puts "No Mail Dir entries found for $userlogin"
}
system "rm /tmp/tattle1.tmp"
puts "#################################################################"
puts "$userlogin excess files and directories found on mail server"
puts "#################################################################"
set counter 0
if { [file exists "/var/mail/$userlogin"] == 1 } {
incr counter
puts "File: /var/mail/$userlogin"
}
if { [file isdirectory "/var/imsp/user/$userlogin"] == 1 } {
incr counter
puts "Directory: /var/imsp/user/$userlogin"
}
if { $counter == 0 } {
puts "No excess mail server files found for $userlogin"
}
puts "#################################################################"
puts "DON'T FORGET TO:"
puts " 1. Do this".
puts " 2. Do that."
puts " 3. Do everything else."
puts "#################################################################"

exit



, Mike