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:So maybe trybatch -f /var/www/dbCAN/data/blast/$jobid/cmd.sh?Apparently,
batchno longer supports arguments (I gotbatch accepts no parameterswhen I tried to run it with the-fargument). The following worked equivalently for me (obviously using a different file path):Reference: #419547 – at: batch no longer accepts parameters.