'Cronjob won't trigger .sh script

I have made this Cronjob that should run some tests. My script works, but cronjob won't trigger it.

Cronjob looks like this:

*/1 * * * * /bin/sh cd ~/Desktop/abc.sh

I want it to run every minute, just for testing purposes.

And my script is:

while read LINE; do curl -o /dev/null --silent --head --write-out "%{http_code} $LINE\n" "$LINE"; done < todo | tee test_results.txt

I can't even find the solution on google or youtube.



Solution 1:[1]

If you added #!/bin/bash to your script, then your cronjob should look like:

* * * * * ~/Desktop/abc.sh

Or

* * * * * /home/USER/Desktop/abc.sh

In the first case you have to run cronjob from the same user where of the Desktop folder.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Robert Cojocaru