In many environments cron executes commands using sh, while many people assume it will use bash.
Suggestions to test or fix this for a failing command:
Try running the command in
shto see if it works:sh -c "mycommand"Wrap the command in a bash subshell to make sure it gets run in bash:
bash -c "mybashcommand"Tell cron to run all commands in bash by setting the shell at the top of your crontab:
SHELL=/bin/bashIf the command is a script, make sure the script contains a shebang:
#!/bin/bash