https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-05-13T22:15:35ZRedmineRedmine - Feature #3269: Writing a single batch file for all rake taskshttps://www.redmine.org/issues/3269?journal_id=92332009-05-13T22:15:35ZAdam Piotr Żochowski
<ul></ul><p>Since you are mentioning Batch files, I am assuming you are doing this under Windows.</p>
<p>just create a batch file that will look like named something like : <strong>cron.hourly.cmd</strong><br /><pre>
:: process hourly emails
@call rake redmine:email:receive_imap RAILS_ENV="production" host=myhostad...
@call rake redmine:email:receive_imap RAILS_ENV="production" host=myhostad..
</pre></p>
<p>notes:</p>
<p>A line that starts with two colons is a comment</p>
<p>A line that starts with '@' sign is not output to stdout (typical batch files work as if ran 'bash -x', to avoid this behaviour either add a line '@echo off' or prefix each line with an at sign).</p>
<p>Batch file calling a batch file behaves like a 'goto', meaning if you do not say 'call' your first rake will finish execution and never return to your batch files.</p>
<p>Now you can setup a schedule to run this batch file every hour in the windows task scheduler (or by using at command).</p>
<p>Kind regards</p>