I have a shellscript which can be successfully executed in UNIX with command sh Shell_script.sh
; but I want it to run automatically. So I just configured a cronjob to run the script using crontab -e
.
The cronjob added is below:
0 7-23 * * * * /home/folder1/folder2/Shell_script.sh > /dev/null 2>&1
I want it to be executed hourly from 7AM to 11PM every day.
My shell script has a she-bang #!/bin/bash
. I am getting a mail every hour with the content:
Your "cron" job on servername * /home/folder1/folder2/Shell_script.sh > /dev/null 2>&1
produced the following output:
sh: +61: execute permission denied
You have extra *
in your cron line which is interpreting as Username. Once you delete it it will be fine executed.
also consider if your Shell_script.sh is not executable, you need run with sh
(if it's written in sh) or bash
if it's bash written.
0 7-23 * * * bash /home/folder1/folder2/Shell_script.sh > /dev/null 2>&1
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments