This is on an Ubuntu system. When a user submits a job to our website, I want to run it as a batch job. Cmd.sh is a shell script. When run manually in terminal, the script executes fine, but for some reason won't run as a batch job. The current PHP is:
system("echo /var/www/dbCAN/data/blast/$jobid/cmd.sh | batch");
It doesn't print an error or crash, it simply doesn't submit the job. Furthermore, if I change this code to just remove the "| batch", the file executes normally. The reason I don't want to execute it directly is it's an intensive process that can take some time, and we typically email the user when their job is complete (and not run multiple jobs at once). Anyone have any ideas why this isn't working? I know the path is correct but I'm not sure about batch usage. Help is appreciated :)
From man batch
:
For both at and batch, commands are read from standard input or the file specified with the -f option and executed.
So maybe try batch -f /var/www/dbCAN/data/blast/$jobid/cmd.sh
?
Apparently, batch
no longer supports arguments (I got batch accepts no parameters
when I tried to run it with the -f
argument). The following worked equivalently for me (obviously using a different file path):
at -q b -m now -f /var/www/dbCAN/data/blast/$jobid/cmd.sh
Reference: #419547 - at: batch no longer accepts parameters.