As far as I know crontab can execute sbatch commands.  I wrote a workflow
application that calls sbatch from within Python, and that Python code is
executed from cron without issue.

Maybe try changing the sbatch line to this:

sbatch calculate.sh &> rn.txt

There may be something in STDERR not getting redirected to the file.

- Trey

=============================

Trey Dockendorf
Systems Analyst I
Texas A&M University
Academy for Advanced Telecommunications and Learning Technologies
Phone: (979)458-2396
Email: [email protected]
Jabber: [email protected]

On Wed, Apr 1, 2015 at 3:14 PM, Carl E. Fields <[email protected]> wrote:

>  Hi Everyone,
>
> I wish to have crontab check every minute for the existence of a file,
> then if such file exists, execute "sbatch calculate.sh".
>
> crontab is written as:
>
> * * * * * SlurmUser cd /var/www/virtual/mesa-web.asu.edu/html/services &&
> /bin/sh ./test.sh
>
> the file test.sh contains:
>
> #!/bin/bash
>
>
> if [ -f inlist_user_input ]
>
>     then
>
>     sbatch calculate.sh > 'rn.txt'
>
>     else
>
>    exit
>
> fi
>
>
>
> lastly, calculate.sh is a typical job batch script
>
> When i $ ./test.sh by hand
>
> I get the typical out put "Submitted job id ##" to the rn.txt file
>
> However, when I have crontab do the same thing,
> rn.txt is created, but empty.
>
> Can crontab processes execute sbatch commands? Am I missing a particular
> permission setting?
>
> all files involved are executable by "SlurmUser"
>
> Thanks ahead of time,
>
> Carl
>
>

Reply via email to