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.

6
  • 2
    Start by adding logging like this @reboot sleep 15; /root/tunnel.sh >> /tmp/some.log 2>&1 reading that log will give you a clue Commented Mar 22, 2018 at 18:17
  • 2
    does /root/tunnel.sh rely on any shell variables (or activities) performed by your login shell? Is the correct she-bang line at the top of it? Commented Mar 22, 2018 at 18:20
  • You're not mentioning what happens when the cronjob runs. Do you get an email with any error messages from the cron daemon? Commented Mar 22, 2018 at 19:00
  • @Tagwint I made it log the action and the log tell me /root/tunnel.sh: line 2: ip: command not found Does this just mean I'm not waiting it long enough or what? Since the commands work fine if I execute the script from the bash terminal or if I paste all the commands from it one by one Commented Mar 22, 2018 at 19:11
  • @JeffSchaller I didn't have the she-bang on the top of the script but I added it now and did what Tagwint told me to do to log the output of the script. since it outputs what I posted in the above comment I presume it's not a problem with variables or activities done by the shell. Commented Mar 22, 2018 at 19:15