Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Convert mail archive from daily to monthly
  •  
r1sh

Messages: 87
Karma: -4
Send a private message to this user
Hello!

We've got mail dailty mail archive, is there any script or way to convert them to monthly mail archive?
  •  
Machete

Messages: 262
Karma: 5
Send a private message to this user
Hello -

Here are 2 scripts I ran on my Linux box (I'm currently running Kerio on Windows). What these did (when placed in daily cron job) is:
Step 1: create a folder for the current Year/Month named YYYY-MM
Step 2: Move previous day's archive into the month folder
Step 3: Archive/Compress (.ZIP) the 13th oldest Month folder so I only ever had 12 months of uncompressed email in the archive - but could easily uncompress/restore a particular time period if I needed to find something specific.

Make Folder/Move Date (Steps 1 & 2)
#!/bin/bash

cd /opt/kerio/mailserver/store/archive
mkdir -p $(date --date=yesterday +%Y-%m)
mv $(date --date=yesterday +%Y-%b-%d) $(date --date=yesterday +%Y-%m)


Archive/Compress 13 month old folder (Step 3)
#!/bin/bash

cd /mnt/opt/kerio/mailserver/store/archive
archive_folder=$(date --date="13 months ago" +%Y/%Y-%m)
zip -s 2000m -r $archive_folder.zip $archive_folder
rm -rf $archive_folder


NOTE: Use these at your own risk - I only recommend implementing if you have working knowledge of Linux. As always, backup your data before running and test on a non-production server.

Edit: Correct a couple typo-s

[Updated on: Mon, 29 December 2014 18:15]

  •  
r1sh

Messages: 87
Karma: -4
Send a private message to this user
hello!

actually it isn't what i need.

There is mail archive, a folder which contains all incoming and outgoing letters.

The previos server configuration was to make each day new folder and place in it all mail.

Some days ago I switched it to making only each month new folder.

And I don't know how to convert all letters from previos days, because each day contains file with name 0000000 and 0000000a and so on...
  •  
Machete

Messages: 262
Karma: 5
Send a private message to this user
You want to:
- convert messages in archive folders by day to folders by month
or
- convert messages in archive folders by month to day

In either case, I would log into the Webmail and move the messages into folders how you want. I would not mess with moving messages from within the message store.
  •  
r1sh

Messages: 87
Karma: -4
Send a private message to this user
Hello!

I want:

convert messages in archive folders by day to folders by month

Isn't it a really long work:

eneter every day, select letters on every page and copy them?

[Updated on: Thu, 19 February 2015 08:09]

Previous Topic: Outlook 15.6 and IMAP folders
Next Topic: Malformed MIME content causing all mail to be rejected
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Mon Feb 20 16:25:01 CET 2017

Total time taken to generate the page: 0.00929 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.