ejabberd - Comments for "mod_cron for backup" https://www.ejabberd.im/node/2836 en mod_cron for backup https://www.ejabberd.im/node/2836#comment-51777 <p>Thanks for the comments and suggestion.</p> <p>I am planning on doing a database backup only once a day or so, not every 10 min. The 10 min setting is only for testing. For obvious reason, I do not want to wait 24 hours to find out if the mod_cron setting is working or not.</p> <p>I try both of your suggestions for scheduled backup with mod_cron. The one with mnesia works perfectly, whereas the one with ejabberd_ctl does not work at all. But I do have a working solution now.</p> <p>I am aware of that ejabberd 1.1.3 will backup once for each vhost. Will switch to 2.0 release when we are ready. Thanks again.</p> Mon, 11 Feb 2008 04:16:30 +0000 Anonymous comment 51777 at https://www.ejabberd.im Wrong task data https://www.ejabberd.im/node/2836#comment-51761 <div class="quote-msg"> <div class="quote-author"><em>yskwong</em> wrote:</div> <p>{modules,<br /> [<br /> ....<br /> {mod_cron, [{tasks, [<br /> {10, minutes, ejabberd_ctl, backup, ["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]}<br /> ]}]},<br /> .... </p></div> <p>I think you don't need to make a backup of the database every 10 minutes. Note that ejabberd consumes a lot of RAM and CPU when doing a backup of a big database. And the database is stored in the spool directory anyway. So the purpose of making a backup is to store it in a different machine in case of a serious hard drive crash, etc.</p> <div class="quote-msg"> <div class="quote-author"><em>yskwong</em> wrote:</div> <p>On restarting ejabberd and after 10 minutes, the following error is reported in the ejabberd.log:</p> <p>=ERROR REPORT==== 2008-02-07 10:08:43 ===<br /> E(&lt;0.418.0&gt;:mod_cron:85): Error in scheduled task ejabberd_ctl:backup["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]:<br /> {undef,[{ejabberd_ctl,backup,<br /> ["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]},<br /> {mod_cron,run_task,3}]}</p> <p>=ERROR REPORT==== 2008-02-07 10:08:43 ===<br /> E(&lt;0.419.0&gt;:mod_cron:85): Error in scheduled task ejabberd_ctl:backup["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]:<br /> {undef,[{ejabberd_ctl,backup,<br /> ["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]},<br /> {mod_cron,run_task,3}]}</p> <p>=ERROR REPORT==== 2008-02-07 10:08:43 ===<br /> E(&lt;0.420.0&gt;:mod_cron:85): Error in scheduled task ejabberd_ctl:backup["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]:<br /> {undef,[{ejabberd_ctl,backup,<br /> ["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]},<br /> {mod_cron,run_task,3}]} </p></div> <p>Where did you read about ejabberd_ctl backup? This is not correct. Try with</p> <pre>{10, minutes, ejabberd_ctl, process, [[backup, "C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]]}</pre><p>or maybe</p> <pre>{10, minutes, mnesia, backup, ["C:/Program Files/ejabberd-1.1.3/bin/ejabberd.backup"]}</pre><p> Also, you get the error three times. Do you have three vhosts in your ejabberd server? Note that the database backup will backup all the database. So you only need to backup the database once. If you define mod_cron as explained in the README.txt, the module is started for each vhost, and it will make the same identical backup three times!</p> <p>This can be solved using the configuration 'host_config' in ejabberd 2.0.0, so that you can enable mod_cron only in a specific vhost.</p> Thu, 07 Feb 2008 23:58:41 +0000 mfoss comment 51761 at https://www.ejabberd.im