In your question, the cron you are running goes like
2 * * * * . $HOME/.bash_profile ~/jek.sh
There are multiple things you need to correct/verify with this entry
- Check that file permissions for both is
777
or775
(rwx
). If not, then change the file permission usingchmod 777 ~/jek.sh
- Check that each of them define in their shebang line which language script they are (
#!/usr/local/env sh
) - Separate the two scripts by an
&&
or;
so that both of them are run properly. Currently, the second script's name will be treated as a parameter for the first. - There is a
.
after the2 * * * *
part. I am not sure why you added it - it has to be removed.
In case @psny's answer doesn't work for you, try exporting your path variable in your cron entry. After that, the whole thing should work properly. Steps
1) Find the value of $PATH
echo $PATH #Lets call the string :some/path/:another/path
2) Manually set the path in your crontab entry
2 * * * * export PATH=:some/path/:another/path && /bin/bash /home/username/jek.sh