Re: [qmailtoaster] Re: Cleaning house

2011-12-13 Thread Casey Price


Casey Price

Smile Global Technical Support
Submit or check trouble tickets http://billing.smileglobal.com
www.smileglobal.com 

Follow us on Twitter 
Like us on Facebook 

On 12/13/11 12:25 PM, Dave wrote:
Not a coder or scripter, but if anyone wanted to backup all but the 
maildirs,

can they not just copy the qtp-backup,
rename it,
Then comment out the relevent lines:

#echo "Backing up vpopmail domains"
*#tar cfj $backupdest/$VPOPMAIL /home/vpopmail/domains > /dev/null 2>&1*

or any other items they dont want in a daily backup?

Dave
I'm with Dave on this one...I know enough scripting to get me into 
trouble and before basic management/maintenance (and I can usually break 
down a script and figure out how it works)...that being said, I think 
Dave is right about this - granted its a quick and dirty way of doing it.


I think Eric has the right idea with using rsync, as that would be alot 
more efficient and allow you to something more along the lines of 
snapshots or incrementals versus full backups.


I do have a few scripts I found and did some modifications to that allow 
you to backup your users on a domain-level, and I suppose if you had a 
text file with all of that info you could pass that to the script.


Though it really depends on what your requirements are and what your 
desired outcome is. Another one to look at (we currently use this to 
backup our production mail servers) is rsnapshot.

On 12/13/2011 11:33 AM, Eric Shubert wrote:

On 12/13/2011 10:34 AM, Dave wrote:

Found this on the wiki:

http://wiki.qmailtoaster.com/index.php/Maintain_Trash_and_Spam_folder
maybe I should add my adjustments to the wiki?


Modified the qtp-clean-trash to add a clean up of old emails.
As recently our backups have been taking over 14 hours, and are around
30 Gb.

So I modified the script to delete any email in the users " CUR "
folder, older than 31 days .

If doing this, make sure you send a server wide email, to alert all
users what you are doing.
I gave then 2 weeks notice, and ran it last night.

Worked like a charm.
+++ 




#!/bin/bash

# 09/11/09 - Eric 
# changed -ctime to -mtime
# refactored to simplify a bit
#
# 07/06/07 - Jake 
# This is a modified version of Erik Espinoza's

# #
# 23/10/2007 - Davide 
# Added the possibility to use an external file to configure the
deltrash value
# just put in DELTIME_FILE the path of the file which contain the value

# 12/12/11
# Modified again by Dave MacDonald 
# It has been modified to be used as an email cleaner.
# It will delete files in the users CUR folder that are older than 31
# days, and can be modified by adjusting the DELTIME variable.

# default DELTIME value
DELTIME=31

# config file for deltrash
DELTIME_FILE="/var/qmail/control/deltrash"

# see if there is a configuration file for DELTIME
if [ -e "$DELTIME_FILE" ] ; then
DELTIME_TMP=`cat $DELTIME_FILE`
if [ "$(echo $DELTIME_TMP | grep "^[[:digit:]]*$")" ] ; then
DELTIME=$DELTIME_TMP
fi
fi

# find and process each Domain user accounts
# then find and process each file in the CUR directory

for directory in $(find /home/vpopmail/domains -type d -name cur); do
for file in $(find $directory -type f -mtime +$DELTIME); do
rm -f ${file} >/dev/null 2>&1
done
done

+++ 







- 





FWIW, I prefer using rsync to back up maildirs, off site. Of course, 
this does not include backing up domains and other non-mail user 
data/settings. That needs to be done separately.


Using qtp-backup for daily backups is convenient, but not very 
efficient. qtp-backup is intended more for migrations. I've had 
thoughts of reworking qtp-backup to have various options for backing 
up different portions of QMT data (everything except maildirs for 
example), but haven't done so yet. Anyone interested in this?






Re: [qmailtoaster] Re: Cleaning house

2011-12-13 Thread Dave
Not a coder or scripter, but if anyone wanted to backup all but the 
maildirs,

can they not just copy the qtp-backup,
rename it,
Then comment out the relevent lines:

#echo "Backing up vpopmail domains"
*#tar cfj $backupdest/$VPOPMAIL /home/vpopmail/domains > /dev/null 2>&1*

or any other items they dont want in a daily backup?

Dave

On 12/13/2011 11:33 AM, Eric Shubert wrote:

On 12/13/2011 10:34 AM, Dave wrote:

Found this on the wiki:

http://wiki.qmailtoaster.com/index.php/Maintain_Trash_and_Spam_folder
maybe I should add my adjustments to the wiki?


Modified the qtp-clean-trash to add a clean up of old emails.
As recently our backups have been taking over 14 hours, and are around
30 Gb.

So I modified the script to delete any email in the users " CUR "
folder, older than 31 days .

If doing this, make sure you send a server wide email, to alert all
users what you are doing.
I gave then 2 weeks notice, and ran it last night.

Worked like a charm.
+++ 




#!/bin/bash

# 09/11/09 - Eric 
# changed -ctime to -mtime
# refactored to simplify a bit
#
# 07/06/07 - Jake 
# This is a modified version of Erik Espinoza's

# #
# 23/10/2007 - Davide 
# Added the possibility to use an external file to configure the
deltrash value
# just put in DELTIME_FILE the path of the file which contain the value

# 12/12/11
# Modified again by Dave MacDonald 
# It has been modified to be used as an email cleaner.
# It will delete files in the users CUR folder that are older than 31
# days, and can be modified by adjusting the DELTIME variable.

# default DELTIME value
DELTIME=31

# config file for deltrash
DELTIME_FILE="/var/qmail/control/deltrash"

# see if there is a configuration file for DELTIME
if [ -e "$DELTIME_FILE" ] ; then
DELTIME_TMP=`cat $DELTIME_FILE`
if [ "$(echo $DELTIME_TMP | grep "^[[:digit:]]*$")" ] ; then
DELTIME=$DELTIME_TMP
fi
fi

# find and process each Domain user accounts
# then find and process each file in the CUR directory

for directory in $(find /home/vpopmail/domains -type d -name cur); do
for file in $(find $directory -type f -mtime +$DELTIME); do
rm -f ${file} >/dev/null 2>&1
done
done

+++ 







- 





FWIW, I prefer using rsync to back up maildirs, off site. Of course, 
this does not include backing up domains and other non-mail user 
data/settings. That needs to be done separately.


Using qtp-backup for daily backups is convenient, but not very 
efficient. qtp-backup is intended more for migrations. I've had 
thoughts of reworking qtp-backup to have various options for backing 
up different portions of QMT data (everything except maildirs for 
example), but haven't done so yet. Anyone interested in this?






[qmailtoaster] Re: Cleaning house

2011-12-13 Thread Eric Shubert

On 12/13/2011 10:34 AM, Dave wrote:

Found this on the wiki:

http://wiki.qmailtoaster.com/index.php/Maintain_Trash_and_Spam_folder
maybe I should add my adjustments to the wiki?


Modified the qtp-clean-trash to add a clean up of old emails.
As recently our backups have been taking over 14 hours, and are around
30 Gb.

So I modified the script to delete any email in the users " CUR "
folder, older than 31 days .

If doing this, make sure you send a server wide email, to alert all
users what you are doing.
I gave then 2 weeks notice, and ran it last night.

Worked like a charm.
+++


#!/bin/bash

# 09/11/09 - Eric 
# changed -ctime to -mtime
# refactored to simplify a bit
#
# 07/06/07 - Jake 
# This is a modified version of Erik Espinoza's

# #
# 23/10/2007 - Davide 
# Added the possibility to use an external file to configure the
deltrash value
# just put in DELTIME_FILE the path of the file which contain the value

# 12/12/11
# Modified again by Dave MacDonald 
# It has been modified to be used as an email cleaner.
# It will delete files in the users CUR folder that are older than 31
# days, and can be modified by adjusting the DELTIME variable.

# default DELTIME value
DELTIME=31

# config file for deltrash
DELTIME_FILE="/var/qmail/control/deltrash"

# see if there is a configuration file for DELTIME
if [ -e "$DELTIME_FILE" ] ; then
DELTIME_TMP=`cat $DELTIME_FILE`
if [ "$(echo $DELTIME_TMP | grep "^[[:digit:]]*$")" ] ; then
DELTIME=$DELTIME_TMP
fi
fi

# find and process each Domain user accounts
# then find and process each file in the CUR directory

for directory in $(find /home/vpopmail/domains -type d -name cur); do
for file in $(find $directory -type f -mtime +$DELTIME); do
rm -f ${file} >/dev/null 2>&1
done
done

+++





-



FWIW, I prefer using rsync to back up maildirs, off site. Of course, 
this does not include backing up domains and other non-mail user 
data/settings. That needs to be done separately.


Using qtp-backup for daily backups is convenient, but not very 
efficient. qtp-backup is intended more for migrations. I've had thoughts 
of reworking qtp-backup to have various options for backing up different 
portions of QMT data (everything except maildirs for example), but 
haven't done so yet. Anyone interested in this?


--
-Eric 'shubes'


-
Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)
   Vickers Consulting Group offers Qmailtoaster support and installations.
 If you need professional help with your setup, contact them today!
-
Please visit qmailtoaster.com for the latest news, updates, and packages.

 To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com

For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com