I am wanting to be able to set up a script or event whereby my mailboxes are compressed on a schedule, such as weekly. I tried setting up a simple script with the compressmailbox command and using the Tools>Events?Timed to establish the event. Using the menu, I selected the script to run and ticked the box to run once every week. However, I found that the script runs everytime I start Pocomail, although the next start date is computed correctly - but ignored. If I untick the 'repeat' box, the script doesn't run at all. Is this a bug, or am I misunderstanding timed events? One of the options is to run a script so I'm guessing it's a bug. Please advise.

Also, since my real goal is to run the compressmailbox command on a schedule, is there a script that can execute a command on a scheduled basis? That's my real objective, but I'm surprised that the timed event feature doesn't do it. Thanks,
david

I will address this bit. (Timer events appear to be functioning properly here -- Poco 4.8, Win7.) Scripts can be triggered
- by filter
- by events
- manually
- by a running script (CallExternal)
- by command line (poco.exe /r "My Script")

To schedule a script command, the best bet is Poco's own timer events, especially if you want your script to be triggered only while Poco is running. An alternative is Windows Task Scheduler or any similar scheduler/reminder program, especially if you want your script to be triggered regardless of whether Poco is already running. A third choice -- a distant third -- is to run a script at every startup (but hey, that would be a Poco Event) and have the script check a scheduler routine programmed in PocoScript. Ugh.

{ Get today's date }GetDate $TodayDate { Calculate the difference in days since last backup }SubDays #diff $TodayDate $CompressionDate

{ Compare the difference to user setting }if #diff > $userdata1 then PerformCompression {following handles when there is no value in CompressionDate variable ie. it's probably the first run}if #diff < 0 then PerformCompression { Exit if the difference is not greater }Exit

{perform compression and set the last compression date}:PerformCompressionCompressMailbox "*"Set $CompressionDate $TodayDateExportVar $CompressionDate $inifile

After a second cup of coffee...
Owing to the reported explosiveness of the CompressMailbox command when it collides with the downloading of mail, I recommend that the method I outlined not be used and that Tomas's script be used only with a guarantee that the CompressMailbox line will never run while mail is downloading, either automatically or manually.

Thanks for the discussion and the help. Tomas's solution works great if set to run as an event at QUIT. That ensures it never interferes with downloading mail. It's great being able to come to this forum and go away with solutions. david

dskirk wrote:I am wanting to be able to set up a script or event whereby my mailboxes are compressed on a schedule, such as weekly. I tried setting up a simple script with the compressmailbox command and using the Tools>Events?Timed to establish the event. Using the menu, I selected the script to run and ticked the box to run once every week. However, I found that the script runs everytime I start Pocomail, although the next start date is computed correctly - but ignored. If I untick the 'repeat' box, the script doesn't run at all. Is this a bug, or am I misunderstanding timed events? One of the options is to run a script so I'm guessing it's a bug. Please advise.

Also, since my real goal is to run the compressmailbox command on a schedule, is there a script that can execute a command on a scheduled basis? That's my real objective, but I'm surprised that the timed event feature doesn't do it. Thanks,david

My last impression was that with 4.8, mailboxes were automatically compressed when needed - no need to set up a script or do it manually.

Shy

Feel free to add 781 posts to the number of posts shown by my avatar..

ShyWriter wrote:My last impression was that with 4.8, mailboxes were automatically compressed when needed - no need to set up a script or do it manually.

That's true ever since Pocomail was released I believe. I forgot the reasons (except one, someone said they don't like wasting the time waiting for automatic compression to happen, as it of course starts when they want to use Pocomail - when folder is entered - that's why choose to overcome automatic compression by running compression at the time when it doesn't disturb them) they shared with me but there are more users who have the need to compress folders on their own.

Tomas wrote:Thanks Mark for the reminder about CompressMailbox quirks.

ShyWriter wrote:My last impression was that with 4.8, mailboxes were automatically compressed when needed - no need to set up a script or do it manually.

That's true ever since Pocomail was released I believe.[...]

Actually, auto-compression has NOT been around since day one. In fact, in many of the earlier releases, every time a person had a weird problem with POCO, one of the first things always suggested by us in fixing the problem was, "Compress your mailboxes." That fixed many a problem.

Shy

Feel free to add 781 posts to the number of posts shown by my avatar..