Hi Stephan,
From the slurm.conf docs:
---
BatchFlag
Jobs submitted using the sbatch command have BatchFlag set to 1. Jobs submitted using other commands have BatchFlag set to 0.
---
You can look that up e.g. with scontrol show job <jobid>. I haven't checked though how to access that via lua. If you know, let me know, I'd be interested as well.
Example:
# scontrol show job 128922
JobId=128922 JobName=sleep
...
JobState=RUNNING Reason=None Dependency=(null)
Requeue=1 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0
RunTime=00:00:54 TimeLimit=00:30:00 TimeMin=N/A
Cheers,
Florian