Forums

Running bash script in task scheduler


1
2
3
4
5
6
#!/bin/bash
python2.7 /home/veepsirtt/AmoFinder.xrange-100.py &
python2.7 /home/veepsirtt/AmoFinder.xrange-200.py &
python2.7 /home/veepsirtt/AmoFinder.xrange-300.py &
python2.7 /home/veepsirtt/AmoFinder.xrange-400.py &
python2.7 /home/veepsirtt/AmoFinder.xrange-500.py &

while running the above commands in task scheduler it raises

File "/home/veepsirtt/AmoFinder-py-bash.py", line 2 python2.7 /home/veepsirtt/AmoFinder.xrange-100.py & ^ SyntaxError: invalid syntax

2018-02-03 18:46:09 -- Completed task, took 5.00 seconds, return code was 1. the same codes are working in the console.How to run this in parallel?.

Why is your bash script ending with .py?

You should have it end with .sh, and also make sure it is executable.

Otherwise, explicitly run it as bash /path/to/your/script.sh

changed to bash /home/veepsirtt/AmoFinder-py-bash.sh works fine. thank you conrad