On Tue, 06 Jul 2004 08:30:15 +0000 Klaus Johannes Rusch
<KlausRusch(_at_)atmedia(_dot_)net> wrote:
Google Kreme wrote:
I would do
cat $HOME/Mail/sa-learn-spam > $HOME/Mail/sa-learn-spam.running
cat /dev/null > $HOME/Mail/sa-learn-spam
Ah yes, that nicely eliminates the need to set permissions indeed but on
a busy server could still result in changes to sa-learn-spam being
overwritten (which is probably okay for just learning spam).
Probably faster. Maybe safer. Doesn't 'cp' copy to memory then re-write out
to disk while 'cat' acts in a serial, line by line, manner?
Still lose anything written to sa-learn-spam while the 'cp' operation is
taking place and before the file truncation happens. But using 'cp' and
"echo style" truncation rather than 'cat' may save a few cycles.
So....
"cp $HOME/Mail/sa-learn-spam $HOME/Mail/sa-learn-spam.running"
"> $HOME/Mail/sa-learn-spam"
(quote marks added so you know the "> $HOME..." is really a command and not
a stray quoted email line mistake)
Of all the suggestions it's probably best to go ahead and write a script to
use 'mv' unless you can set a lock on 'sa-learn-spam' to ensure it isn't
written to during the copy/truncate operation. If it's truncated in the
middle of a write then the next time you copy it for feeding to SA the
first part will be "half a message" (whatever was left of what was being
written when the file was truncated). SA may not appreciate that.
Gerald
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail