Thread View: de.admin.mail
1 messages
1 total messages
Started by Thomas Huppertz
Fri, 22 Jan 1993 04:36
Script: Backup von bsmtp-batches
Author: Thomas Huppertz
Date: Fri, 22 Jan 1993 04:36
Date: Fri, 22 Jan 1993 04:36
99 lines
3090 bytes
3090 bytes
Hallo,
an alle, die batch_smtp Mailverbindungen nutzen ...
Kuerzlich sind hier mehrere bsmtp-batches mit diversen Mails zu einem
Nachbarsystem geplatzt (Plattenplatzprobleme beim Nachbarsystem).
Aufgrund des smail-log habe ich die betreffenden Mail-Absender
alle informieren koennen, so dass wieder alles im Lot war.
Um solche Probleme in Zukunft zu vermeiden, sichere ich jetzt alle
batches als *.Z, so dass man den batch ggf. nach Problemen wieder ein
zweites Mal ausfuehren koennte. Da es ja auch fuer andere Systeme (die
batch_smtp nutzen) von Interesse sein koennte ...
... hier das modifizierte Script 'batchsmtp' dazu:
(Aenderungen mit #*** gekennzeichnet)
======================================================================
#!/bin/sh
# @(#)samples/bsmtp/batchsmtp.sh 1.5 7/30/92 06:03:45
# deliver messages accumlated into subdirectories of the
# outq spool directory. Subdirectory names are based on
# the actual hostnames involved:
LOCALHOST=rechner.domain.sub.org
MAXSIZE=100000
#*** Expire zum loeschen der Batch-Sicherungen
EXPIRE_DAYS=14
OUTQ=/usr/spool/smail/outq
UUX=/usr/bin/uux
cd $OUTQ || exit 1
# loop through all of the subdirectories
for i in *
do
(
# change to directory or exit subshell
test -d $i || exit
cd $i || exit 1
# send multiple batches
while :
do
# get the list of message files; quit if none
msgs="`ls q* 2>/dev/null`"
test -n "$msgs" || break
# accumulate until total size exceeds maximum
send=
sz=0
for f in $msgs
do
send="$send $f"
n=`wc -c <$f 2>/dev/null`
test -n "$n" || continue
sz=`expr $sz + $n`
test $sz -lt $MAXSIZE || break
done
# send messages, adding HELO and QUIT commands
( echo "HELO $LOCALHOST"
cat $send
echo QUIT ) | $UUX - $i!rsmtp
#*** Sonderbehandlung zum Sichern
# remove messages that were sent
# rm $send
# Oh, No - please do _not_ !
# Save them if something goes wrong with the mails
Save=`date +%y%m%d%H%M%S`
( echo "HELO $LOCALHOST"
cat $send
echo QUIT ) > $Save
compress $Save
# ... and now delete them
rm $send
done
#*** Expire der Sicherungsfiles
# Alte Files Loeschen
find . -mtime +$EXPIRE_DAYS -exec rm {} \;
)
done
exit 0
--
==================== Gruss: === Thomas === Huppertz ========================
HUPPERTZ EDV-Beratung, Thererstr. 10, 8083 Mammendorf, Germany
Tel. ++49-8145-1569, Fax. ++49-8145-8286
==================== EMail:== thu@huedv.hu.sub.org ==========================
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads