Archive then Delete...

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Archive then Delete...

Postby davidz » Fri Jun 22, 2007 12:54 pm

We want to setup Archiving on the server. So the plan we have come up with goes something like this:
We have archiving turned on with:

Code: Select all

ARCHIVE=bcc:archive@domian.com

Then the plan was to do sxboxexp on the mailbox once a month to an offsite storage location. So if something came up we could simply restore the email a month at a time to temporary mailboxes on the server.

My question is after I do the sxboxexp, I want to empty the archive mailbox so it only ever holds the current months email. After it exports, delete all of it and start fresh. I can't find an option in sxboxemp to remove exported email. So is there some other simple way to delete all the mail in a user's mailbox?

Thanks!
David

dannyt
Scalix
Scalix
Posts: 140
Joined: Mon Aug 08, 2005 11:52 am
Location: UK

Postby dannyt » Fri Jun 22, 2007 12:59 pm

Hi,

Have a read of the man page for omtidyu, it may do what you want with the right options.

Regards,
Danny

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Fri Jun 22, 2007 1:21 pm

Thanks! Here is what I ended up using.

Code: Select all

omtidyu -B -u "Archive User" -Tiowfplr -S -a 0 -d -k -q

I will just run this after my smboxexp.

Thanks again,
David

KevinAnderson

Postby KevinAnderson » Sat Jun 23, 2007 11:20 am

If you really want to be complete, stop the Local Delivery service before you export the data, and leave it stopped until after you've emptied the mailbox. That way there's no fear that you might lose something between the processes running. I suspect this is happening afterhours, so pausing the LD service won't really impact anything.

Kev.

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Mon Jun 25, 2007 9:58 am

Something like this:

Code: Select all

omoff -d0 "Local Delivery"
omon "Local Delivery"


I also assume that by doing this the server will still receive mail just not deliver it to mailboxes?


Just for fun here is the simple script:

Code: Select all

#Output the Start Time
date
#Set the variables
#User to be Archived
USER_NAME=Archive
#Destination on var parition for space
DESTINATION_DIR=/var/tmp/ScalixArchive
#Filename (use June2006.gz format)
DATE=`date +"%B_%Y"`
FILENAME=$DATE.gz
#Full Destination
FINAL_LOCATION=$DESTINATION_DIR/$FILENAME

#Stop local delivery service so no mail gets missed
omoff -d0 "Local Delivery"

#This command Exports the mailbox and gzips it
sxmboxexp -u "$USER_NAME" -a - -F | gzip | cat > $FINAL_LOCATION

#This command Removes all the mail in the mailbox so there is only one month at a time
omtidyu -B -u "$USER_NAME" -Tiowfplr -S -a 0 -d -k -q

#Start local deliver again
omon "Local Delivery"

#Output the End Time
date


I have it run on the 1st day of every month at 12:01 AM.

Thanks for the Help,
David

jillrae
Posts: 275
Joined: Tue Nov 22, 2005 12:26 pm
Location: Accident, MD USA
Contact:

Postby jillrae » Wed Jun 27, 2007 10:12 am

David,

thanks alot for posting your archive & delete script. I have one question. In the line of code:

DATE=`date +"%B_%Y"`

You use the charter ` What keyboard combination do you use to get this charter? I have run across this in other scripts and haven't found out out to create it.

Thanks

jillrae

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Wed Jun 27, 2007 10:26 am

jillrae wrote:You use the charter ` What keyboard combination do you use to get this charter? I have run across this in other scripts and haven't found out out to create it.


To the left of the number 1 key and above the tab key. A shift gets you a tilde ~ and no shift is the tick ` mark.

jillrae
Posts: 275
Joined: Tue Nov 22, 2005 12:26 pm
Location: Accident, MD USA
Contact:

Postby jillrae » Wed Jun 27, 2007 11:02 am

Thank you. I can now "tick" with the best of 'em! :-)

jillrae


Return to “Scalix Server”



Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron