ejabberd - Comments for "mod_cron errors" https://www.ejabberd.im/node/3364 en cheers https://www.ejabberd.im/node/3364#comment-53969 <p>That seems to have done the trick, nicely spotted. Thanks for you help! :)</p> Tue, 27 Jan 2009 12:58:56 +0000 dnel comment 53969 at https://www.ejabberd.im Check the configuration https://www.ejabberd.im/node/3364#comment-53960 <p>I think you have put something like this, which is wrong:</p> <pre> {modules, [ {tasks, [ {1, days, file, rename, ["/tmp/ejabberd/backups/last.backup", "/tmp/ejabberd/backups/previous.backup"]}, {1, days, mnesia, backup, ["/tmp/ejabberd/backups/last.backup"]} ]}, {mod_adhoc, []}, ... ]}. </pre><p> This is correct:</p> <pre> {modules, [ {mod_cron, [{tasks, [ {1, days, file, rename, ["/tmp/ejabberd/backups/last.backup", "/tmp/ejabberd/backups/previous.backup"]}, {1, days, mnesia, backup, ["/tmp/ejabberd/backups/last.backup"]} ]}]}, {mod_adhoc, []}, ... ]}. </pre> Tue, 20 Jan 2009 18:01:47 +0000 mfoss comment 53960 at https://www.ejabberd.im Quote: Did you check the https://www.ejabberd.im/node/3364#comment-53959 <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>Did you check the README.txt of mod_cron? It says: "Requirements: ejabberd trunk SVN 1635 or newer".</p></div> <p>Yes I did, but like probably most admins of public servers I use stable release versions I do not keep a copy of the ejabberd development tree and I do not know what 2.0.2 resolves to in SVN revision numbering, if this information is available I have been unable to find it. It would be helpful to us users that are not involved in development to advise that it is broken in all current release versions.</p> <p>I have recompiled from revision 699 as you suggested which has improved things, the simple module loader without parameters works ok but when I enter the file rename and backup commands as you suggested (copy/paste) I get this error in my log</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>E(&lt;0.8731.23&gt;:gen_mod:67) : {undef,<br /> [{tasks,start,<br /> ["myhost.com",<br /> [{1,days,file,rename,<br /> ["/tmp/ejabberd/backups/last.backup",<br /> "/tmp/ejabberd/backups/previous.backup"]},<br /> {1,days,mnesia,backup,<br /> ["/tmp/ejabberd/backups/last.backup"]}]]},<br /> {gen_mod,start_module,3},<br /> {lists,foreach,2},<br /> {ejabberd_app,start,2},<br /> {application_master,start_it_old,4}]} </p></div> <p>Any further assistance would be appreciated.</p> Tue, 20 Jan 2009 14:45:07 +0000 dnel comment 53959 at https://www.ejabberd.im Recent mod_cron requires ejabberd trunk. Get older mod_cron https://www.ejabberd.im/node/3364#comment-53958 <div class="quote-msg"> <div class="quote-author"><em>dnel</em> wrote:</div> <p>I am using ejabberd 2.0.2 for linux downloaded from this site. Is this module compatible with the 2.x series?</p></div> <p>Did you check the README.txt of mod_cron? It says: "Requirements: ejabberd trunk SVN 1635 or newer".</p> <p>Once an ejabberd release includes such support, mod_cron's README.txt will be updated to mention what ejabberd releases are supported. It will probably some ejabberd 2.1.</p> <p>Fortunately you have an easy solution to get mod_cron to work with ejabberd 2.0.x: use a lightly older mod_cron. I think mod_cron SVN 699 will work with ejabberd 2.0.2. You can get that older code with</p> <pre> svn up -r 699 </pre><p> Remember to enable mod_cron only in one vhost. If you have several vhosts, you should use instead something like this at the end of ejabberd.cfg:</p> <pre> {host_config, "jabber.example.org", [{{add, modules}, [ {mod_cron, []} ] } ]}. </pre><p> If you get mod_cron running with the simple configuration you mentioned, you can later try this:</p> <pre> {modules, [ {mod_cron, [{tasks, [ {1, days, file, rename, ["/tmp/ejabberd/backups/last.backup", "/tmp/ejabberd/backups/previous.backup"]}, {1, days, mnesia, backup, ["/tmp/ejabberd/backups/last.backup"]} ]}]}, ... ]}. </pre><p> With that configuration, after 1 day you start ejabberd, you will see in the logs:</p> <pre> =ERROR REPORT==== 19-Jan-2009::22:21:54 === E(&lt;0.350.0&gt;:mod_cron:101) : Error in scheduled task file:rename["/tmp/ejabberd/backups/last.backup", "/tmp/ejabberd/backups/previous.backup"]: enoent =INFO REPORT==== 19-Jan-2009::22:21:54 === I(&lt;0.351.0&gt;:mod_cron:103) : Scheduled task mnesia:backup["/tmp/ejabberd/backups/last.backup"] finished ok </pre><p>And the file last.backup is created.</p> <p>The next day you will see something like this:</p> <pre> =INFO REPORT==== 19-Jan-2009::22:22:24 === I(&lt;0.374.0&gt;:mod_cron:103) : Scheduled task file:rename["/tmp/ejabberd/backups/last.backup", "/tmp/ejabberd/backups/previous.backup"] finished ok =INFO REPORT==== 19-Jan-2009::22:22:24 === I(&lt;0.375.0&gt;:mod_cron:103) : Scheduled task mnesia:backup["/tmp/ejabberd/backups/last.backup"] finished ok </pre><p>which means last.backup was renamed to previous.backup, and a new backup was stored in last.backup.</p> <p>It would be even better if the backups were named like "ejabberd-2009-01-19-22-22-24.backup", but that doesn't seem possible with mod_cron.</p> Mon, 19 Jan 2009 21:32:40 +0000 mfoss comment 53958 at https://www.ejabberd.im