Search code examples
bashcron

crontab command is not executed


I am new to bash scripting and all.

I am having the following use case.

I have a simple bash file which should execute every 5 min.

I have an AWS-ec2-instance where i copied this file and provided the following configuration in crontab of ec2-instance:

#SHELL=/bin/bash
#PATH=/sbin:/bin:/usr/sbin:/usr/bin
#MAILTO=root

*/1  *  *  *  * /bin/bash  /home/ec2-user/info.sh

unfortunately the crontab is not getting executed, when I run the bash script manually then it is working.

any help is appreciated.

Thanks


Solution

  • If you mean configuration in crontab as in /etc/crontab file, you should add the executor user before the command /bin/bash /home/ec2-user/info.sh.

    See also: Two Other Types of Crontab

    m h dom mon dow user command