help-octave
[Top][All Lists]

## Re: Run script/function at regular intervals

 From: c. Subject: Re: Run script/function at regular intervals Date: Wed, 1 May 2013 11:45:33 +0200

On 1 May 2013, at 10:18, Arnaud Miege <address@hidden> wrote:

>
> On 30 April 2013 17:42, c. <address@hidden> wrote:
>
> I think the best solution for this is to make your script executable by
>
> http://www.gnu.org/software/octave/doc/interpreter/Executable-Octave-Programs.html
>
> and then setup a cron job to run it at given intervals:
>
> http://en.wikipedia.org/wiki/Cron
>
> HTH,
> c.
>
> I have tried adding the shebang with the following line at the beginning of
> my script:
> #! D:\Octave-3.6.4\Octave3.6.4_gcc4.6.2\bin\octave.exe -qf
>
> How do I then turn the script into an executable on Windows? All the examples
> I could find online seem to be related to Unix rather than Windows.
>
> As far as scheduling is concerned, it looks like the best option in Windows
> is to use Scheduled Tasks:
> http://support.microsoft.com/kb/308569
>
> but I need an executable before I get to that.
>
> Thanks,
>
> Arnaud

It's been more than 10 years since I used a windows machine last time,
so I'm not really sure I can help much  here.
If you can't make executable scripts on windows, you may probably work
around the issue by scheduling a task as

octave --eval 'source D:path\to\script\your_script_name.m'

octave --eval 'your_script_name'

this way the executable to run is octave itself, while the script is passed as
a command line option.

HTH,
c.