<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 10.6.2 Dovecot Mail Backups</title>
	<atom:link href="http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 04 Feb 2012 21:26:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jon Brown</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-310</link>
		<dc:creator>Jon Brown</dc:creator>
		<pubDate>Thu, 08 Dec 2011 16:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-310</guid>
		<description>Here is the updated code as requested.

&lt;pre lang=&quot;bash&quot; line=&quot;1&quot;&gt;
#!/bin/bash

# This adds a record to our backup log

echo backup started daily backup `date` &gt;&gt; /Scripts/Logs/Backup_log.txt

# This backs up the files

rsync -avu /location/of/mail/spool /Volumes/backup-volume/

# This adds another record to our backup log

echo backup daily backup completed `date` &gt;&gt; /Scripts/Logs/Backup_log.txt

# This emails the Sys Admin

NOW=$(date +&quot;%m-%d-%Y&quot;)

SUBJECT=&quot;Email Backed Up - &quot;$NOW&quot;&quot;

EMAIL=&quot;email@user.com&quot;

EMAILMESSAGE=&quot;/Scripts/Logs/Backup_log.txt&quot;

mail -s &quot;$SUBJECT&quot; &quot;$EMAIL&quot; &lt; &quot;$EMAILMESSAGE&quot;
&lt;/pre&gt;

The easiest way to start / stop  this is to setup a LaunchD or Cronjob, I prefer Cron since its easier in my opinion to setup. Setup the rsync script that you have below and put the code in a bash script. I use a GUI tool called Cronix http://code.google.com/p/cronnix/ once you download this launch it and put the full path to the bash script at the bottom the cron job code for every ten minutes is

0/10 * * * * * /path/to/bash/script.sh

Here is a screenshot as well using Cronix

&lt;center&gt;&lt;img src=&quot;http://www.jonsblog.org/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-7.06.48-PM-e1309216552505.png&quot;&gt;&lt;/center&gt;</description>
		<content:encoded><![CDATA[<p>Here is the updated code as requested.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This adds a record to our backup log</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> backup started daily backup <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Scripts<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Backup_log.txt
&nbsp;
<span style="color: #666666; font-style: italic;"># This backs up the files</span>
&nbsp;
rsync <span style="color: #660033;">-avu</span> <span style="color: #000000; font-weight: bold;">/</span>location<span style="color: #000000; font-weight: bold;">/</span>of<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>spool <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>backup-volume<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This adds another record to our backup log</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> backup daily backup completed <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Scripts<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Backup_log.txt
&nbsp;
<span style="color: #666666; font-style: italic;"># This emails the Sys Admin</span>
&nbsp;
<span style="color: #007800;">NOW</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%m-%d-%Y&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #007800;">SUBJECT</span>=<span style="color: #ff0000;">&quot;Email Backed Up - &quot;</span><span style="color: #007800;">$NOW</span><span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #007800;">EMAIL</span>=<span style="color: #ff0000;">&quot;email@user.com&quot;</span>
&nbsp;
<span style="color: #007800;">EMAILMESSAGE</span>=<span style="color: #ff0000;">&quot;/Scripts/Logs/Backup_log.txt&quot;</span>
&nbsp;
mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SUBJECT</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$EMAIL</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$EMAILMESSAGE</span>&quot;</span></pre></td></tr></table></div>

<p>The easiest way to start / stop  this is to setup a LaunchD or Cronjob, I prefer Cron since its easier in my opinion to setup. Setup the rsync script that you have below and put the code in a bash script. I use a GUI tool called Cronix <a href="http://code.google.com/p/cronnix/" rel="nofollow">http://code.google.com/p/cronnix/</a> once you download this launch it and put the full path to the bash script at the bottom the cron job code for every ten minutes is</p>
<p>0/10 * * * * * /path/to/bash/script.sh</p>
<p>Here is a screenshot as well using Cronix</p>
<p><center><img src="http://www.jonsblog.org/wp-content/uploads/2011/06/Screen-shot-2011-06-27-at-7.06.48-PM-e1309216552505.png"/></center></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-309</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 07 Dec 2011 21:52:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-309</guid>
		<description>So could we have the updated script, with time/date fix and how you stop/start it as well? 

Thanks</description>
		<content:encoded><![CDATA[<p>So could we have the updated script, with time/date fix and how you stop/start it as well? </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bashpuppet - Backup Dovecot on OS X Server 10.6</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-298</link>
		<dc:creator>Bashpuppet - Backup Dovecot on OS X Server 10.6</dc:creator>
		<pubDate>Fri, 04 Nov 2011 16:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-298</guid>
		<description>[...] In Apples guide for administering the Mail Service they strongly recommends you to stop the mail service before running a backup of it. My previous scripts has done this and contained more code for stopping/checking status/starting than for actually fulfilling it&#8217;s purpose. That was until I read the comments on &#8220;10.6.2 Dovecot Mail Backups&#8221; on Musings of an Apple System Administrator. [...]</description>
		<content:encoded><![CDATA[<p>[...] In Apples guide for administering the Mail Service they strongly recommends you to stop the mail service before running a backup of it. My previous scripts has done this and contained more code for stopping/checking status/starting than for actually fulfilling it&#8217;s purpose. That was until I read the comments on &#8220;10.6.2 Dovecot Mail Backups&#8221; on Musings of an Apple System Administrator. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Brown</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-285</link>
		<dc:creator>Jon Brown</dc:creator>
		<pubDate>Mon, 01 Aug 2011 09:25:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-285</guid>
		<description>Yes, I am glad you caught that. First off yes, Cronnix does work in 10.6 all of my machines are 10.6 however in order to run the script you need to put /bin/bash /path/to/script.sh instead of just /path/to/script.sh in the command section. You can see an actual screenshot from my server below.

&lt;center&gt;&lt;img src=&quot;http://www.jonsblog.org/wp-content/uploads/2011/08/shot-e1312190764371.png&quot; alt=&quot;&quot; /&gt;&lt;/center&gt;</description>
		<content:encoded><![CDATA[<p>Yes, I am glad you caught that. First off yes, Cronnix does work in 10.6 all of my machines are 10.6 however in order to run the script you need to put /bin/bash /path/to/script.sh instead of just /path/to/script.sh in the command section. You can see an actual screenshot from my server below.</p>
<p><center><img src="http://www.jonsblog.org/wp-content/uploads/2011/08/shot-e1312190764371.png" alt="" /></center></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty Duncan</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-283</link>
		<dc:creator>Rusty Duncan</dc:creator>
		<pubDate>Mon, 01 Aug 2011 05:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-283</guid>
		<description>I was able to do the backup, delete, restore. Thank you!!

The user had a ton of .Saved folders which I didn&#039;t notice at first until I saw your note about making invisible files visible... It would have caused a panic if I had forgotten those...

So my last question is, does Cronnix still work with 10.6 server? I set up a job to run at hour 22 every day. But it has not run on its own. I&#039;m using your tip for the backup script, which I was able to get working just fine if I simply reference the .sh file via terminal. And, I logged in as root to set up the cron job.

Thanks again!!</description>
		<content:encoded><![CDATA[<p>I was able to do the backup, delete, restore. Thank you!!</p>
<p>The user had a ton of .Saved folders which I didn&#8217;t notice at first until I saw your note about making invisible files visible&#8230; It would have caused a panic if I had forgotten those&#8230;</p>
<p>So my last question is, does Cronnix still work with 10.6 server? I set up a job to run at hour 22 every day. But it has not run on its own. I&#8217;m using your tip for the backup script, which I was able to get working just fine if I simply reference the .sh file via terminal. And, I logged in as root to set up the cron job.</p>
<p>Thanks again!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Brown</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-281</link>
		<dc:creator>Jon Brown</dc:creator>
		<pubDate>Sat, 30 Jul 2011 13:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-281</guid>
		<description>I setup my cron jobs as root so that they will never encounter any permissions issues, this may not be best practice but yes thats what I do.</description>
		<content:encoded><![CDATA[<p>I setup my cron jobs as root so that they will never encounter any permissions issues, this may not be best practice but yes thats what I do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty Duncan</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-279</link>
		<dc:creator>Rusty Duncan</dc:creator>
		<pubDate>Fri, 29 Jul 2011 16:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-279</guid>
		<description>Well answered my own question when i posted it, since the form translated the items into greater than signs... and they worked...

Next question, do I have to log in as root to set up the cron job?

Thanks!</description>
		<content:encoded><![CDATA[<p>Well answered my own question when i posted it, since the form translated the items into greater than signs&#8230; and they worked&#8230;</p>
<p>Next question, do I have to log in as root to set up the cron job?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty Duncan</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-278</link>
		<dc:creator>Rusty Duncan</dc:creator>
		<pubDate>Fri, 29 Jul 2011 16:41:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-278</guid>
		<description>OK one more question. I get the following error trying to run the script for backups.

line 2: syntax error near unexpected token `&amp;&#039;

This is your line 2. (I subbed in my path in my version).
echo backup started daily backup `date` &gt;&gt; /Volumes/EMAIL\ BACKUP/Backup/Logs/Backup_log.txt
 
I looked up $gt; and see that it translates to &gt;. Should I just put the greater than sign in where $gt; appears?

Thanks!</description>
		<content:encoded><![CDATA[<p>OK one more question. I get the following error trying to run the script for backups.</p>
<p>line 2: syntax error near unexpected token `&amp;&#8217;</p>
<p>This is your line 2. (I subbed in my path in my version).<br />
echo backup started daily backup `date` &gt;&gt; /Volumes/EMAIL\ BACKUP/Backup/Logs/Backup_log.txt</p>
<p>I looked up $gt; and see that it translates to &gt;. Should I just put the greater than sign in where $gt; appears?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Brown</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-220</link>
		<dc:creator>Jon Brown</dc:creator>
		<pubDate>Fri, 22 Jul 2011 20:45:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-220</guid>
		<description>You can see into his mail store folder by logging into the server as root. That way you do not need to change any permissions. You should only mess with the folders in the curr directory, this would include the inbox and any other server folders. Do not copy over the index file or the size file (dirsize) the server will automatically take care of rebuilding this. I would go with a new GUID personally its just cleaner, however I do not see any harm in doing it as you outline above.</description>
		<content:encoded><![CDATA[<p>You can see into his mail store folder by logging into the server as root. That way you do not need to change any permissions. You should only mess with the folders in the curr directory, this would include the inbox and any other server folders. Do not copy over the index file or the size file (dirsize) the server will automatically take care of rebuilding this. I would go with a new GUID personally its just cleaner, however I do not see any harm in doing it as you outline above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty Duncan</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/comment-page-1/#comment-219</link>
		<dc:creator>Rusty Duncan</dc:creator>
		<pubDate>Fri, 22 Jul 2011 19:49:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonsblog.org/?p=33#comment-219</guid>
		<description>John:

Thank you so much for the detailed reply.

I believe the permissions on the User&#039;s mail store are set so that I cannot view inside of the directory. Is it OK for me to change that? I think I will have to change the permissions on the new mail store directory as well as the old one. Also, should I just replace the contents of the new one with that of the old? Or are there only certain sub directories that I should be messing with?

Also, do I have to delete the entire User from workgroup manager? Can I just delete the user mail account from the mail maintenance section, then restore it?</description>
		<content:encoded><![CDATA[<p>John:</p>
<p>Thank you so much for the detailed reply.</p>
<p>I believe the permissions on the User&#8217;s mail store are set so that I cannot view inside of the directory. Is it OK for me to change that? I think I will have to change the permissions on the new mail store directory as well as the old one. Also, should I just replace the contents of the new one with that of the old? Or are there only certain sub directories that I should be messing with?</p>
<p>Also, do I have to delete the entire User from workgroup manager? Can I just delete the user mail account from the mail maintenance section, then restore it?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

