Some help with script

Hello,

I am not good with ruby , but I must change something in a script. Can someone help me in the right direction ?

···

-------------------
   def initialize
     # This is the directory where amavisd-new stores the quarantined emails.
     @directory = "/home/amavis/quarantine"
     @dateline = (Date.today - 1).strftime("%Y%m%d")
     @report_date = (Date.today - 1).strftime("%d/%m/%y")
     # This is the file pattern used to match the quarantined spam
     # emails in the quarantined email directory. This is used so that
     # only spam (and not virii etc.) from the report day are matched.
     @file_patt = "spam-*-#{@dateline}-*.gz"
     @spams = Array.new
----------------------
The directory with the spamfiles I need is in /home/amavis/quarantaine/2007-01-17-spam

But this should always be yesterday !

Files in this directory are like : spam-prAizOahLojn.gz
(Anything with spam-*)

I should change something like : Date.today - 1
But what date syntax ?

I would really appreciate your help !

Greetings... Richard Smits

I don't understand: the script reads already "Date.today - 1". So what is your problem?

Regards

  robert

···

On 18.01.2007 13:22, R.Smits wrote:

Hello,

I am not good with ruby , but I must change something in a script. Can someone help me in the right direction ?

-------------------
  def initialize
    # This is the directory where amavisd-new stores the quarantined emails.
    @directory = "/home/amavis/quarantine"
    @dateline = (Date.today - 1).strftime("%Y%m%d")
    @report_date = (Date.today - 1).strftime("%d/%m/%y")
    # This is the file pattern used to match the quarantined spam
    # emails in the quarantined email directory. This is used so that
    # only spam (and not virii etc.) from the report day are matched.
    @file_patt = "spam-*-#{@dateline}-*.gz"
    @spams = Array.new
----------------------
The directory with the spamfiles I need is in /home/amavis/quarantaine/2007-01-17-spam

But this should always be yesterday !

Files in this directory are like : spam-prAizOahLojn.gz
(Anything with spam-*)

I should change something like : Date.today - 1
But what date syntax ?

Robert Klemme wrote:

Hello,

I am not good with ruby , but I must change something in a script. Can someone help me in the right direction ?

-------------------
  def initialize
    # This is the directory where amavisd-new stores the quarantined emails.
    @directory = "/home/amavis/quarantine"
    @dateline = (Date.today - 1).strftime("%Y%m%d")
    @report_date = (Date.today - 1).strftime("%d/%m/%y")
    # This is the file pattern used to match the quarantined spam
    # emails in the quarantined email directory. This is used so that
    # only spam (and not virii etc.) from the report day are matched.
    @file_patt = "spam-*-#{@dateline}-*.gz"
    @spams = Array.new
----------------------
The directory with the spamfiles I need is in /home/amavis/quarantaine/2007-01-17-spam

But this should always be yesterday !

Files in this directory are like : spam-prAizOahLojn.gz
(Anything with spam-*)

I should change something like : Date.today - 1
But what date syntax ?

I don't understand: the script reads already "Date.today - 1". So what is your problem?

Regards

    robert

I got it,

I needed :

     @dateline = (Date.today - 1).strftime("%Y-%m-%d")
     @directory = "/home/amavis/quarantine/#{@dateline}-spam"
     @file_patt = "spam-*.gz"

But now I get a :
./sa-daily-report.rb:101: warning: attempt to close unfinished zstream; reset forced.

There are A LOT of files in that directory, so my guess is that it takes to long.

Greetings... Richard

···

On 18.01.2007 13:22, R.Smits wrote:

Ahem.. What's on that line?

Paulo Jorge Duarte Köch
paulo.koch@gmail.com

···

On 2007/01/18, at 13:35, R.Smits wrote:

But now I get a :
./sa-daily-report.rb:101: warning: attempt to close unfinished zstream; reset forced.