Home > Mobile >  crontab command is not executed
crontab command is not executed

Time:11-24

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

CodePudding user response:

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

CodePudding user response:

Thankyou Victor, basically the user i am using to execute does not have crontab, now it is working fine.

Thanks and regards

  • Related