Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Depending on how you're executing main-script.sh in crontab, it might be executed via /bin/sh instead of /bin/bash. In case of source command it's bash-specific. Try to replace that with . /home/pi/test-script.sh - that should work across the board on all POSIX compliant, bourne-like shells. Let me know if that works for you, and if it does I'll post it as a proper answer Commented Feb 23, 2019 at 9:16
  • You can set SHELL=/bin/bash in your crontab which makes life easier. Commented Feb 23, 2019 at 9:27
  • I don't know how it finds the python script: You don't give an absolute path. Commented Feb 23, 2019 at 9:54
  • @SergiyKolodyazhnyy The script has a hash-bash-slash-bin-slash-bash #!/bin/bash, so a modern sh will launch bash. Commented Feb 23, 2019 at 10:22
  • @ctrl-alt-delor As I mentioned in the comment, "Depending on how you're executing main-script.sh". A sh /path/to/main.sh definitely won't like bashisms (unless it's CentOS where /bin/sh is /bin/bash ). Commented Feb 23, 2019 at 10:30