I have a crontab job setup. In the crontab file, I have a path to a text file. My text file has a wget command (which in turn, executes a PHP file). If the crontab file just has the path to the text file, will it automatically bash (execute) that text file? Or do I need to prefix the path to the text file with bash?
Answer
If the file is executable (check if it has x in ls -l
, if not, then use chmod
to set the executable bit) and the first line contains #!/bin/bash
then it will be interpreted in bash.
The other option is, as you suggest, to pass it as an argument to bash:
/bin/bash /path/to/your/file.sh
No comments:
Post a Comment