procmail
[Top] [All Lists]

Re: [LYb] Re: gziping

1997-05-29 13:06:00
On Wed, 28 May 1997, Stan Ryckman wrote:

It's OK, but I'd like to have gziped messages in backup directory.

Untested, but how about:

:0 c: backup.lock
    {
    :0 c
    $HOME/Mail/backup
    :0 ic
    cd $HOME/Mail/backup && gzip `ls -t msg.* | head -1` && \
        rm -f dummy `ls -t msg.* | sed -e 1,30d`
    }

I'm not exactly sure about the locking here... you now need it
in case two messages arrive at once to avoid having one message
not gzipped and the other gzipped twice (possibly making a mess).
I'm not sure one can lock a nested recipe pair like that.  I'm also not
sure whether that "c" flag should be on the last recipe in the {}'s.

        Won't work... it makes duplicate messages in INBOX, and this in log 
file:

      0       6  ## UX:ls: ERROR: Cannot access msg.*: No such file or directory
      0       6  ## fgrep: can't open /u/lupusy/nobounce
      0       3  ## procmail: Skipped "/u/lupusy/Mail/backup && /usr/sbin/gzip 
&& rm -f dummy"

.------------------------------------------------------------------------.
| lupusy(_at_)afrodita(_dot_)rcub(_dot_)bg(_dot_)ac(_dot_)yu    
http://afrodita.rcub.bg.ac.yu/~lupusy |
`------------------------------------------------------------------------'

<Prev in Thread] Current Thread [Next in Thread>