0

When I try to run a script through crontab, it doesn't work. I don't see my script running when I run `ps aux.

But it works perfectly when I run it manually. Any reason why it's not working?

My script location: /home/my location/myscript

Crontab:

* * * * * /home/my location/myscript
7
  • 2
    What is the exact crontab entry? The one you posted here would break because "my location" has a space in it. Also, is the execute bit set on your script? What user is the crontab for? Some OS's will limit who can run cron.
    – mikem
    Commented Sep 13, 2020 at 6:16
  • 1
    Can you be more exact than just "it doesn't work"? Have you tried to debug the script?
    – harrymc
    Commented Sep 13, 2020 at 9:34
  • Actually "my location" refers to my working directory. Its /home/ec2-user/. The crontab entry is: * * * * * /home/ec2-user/connect. Connect is a script file. When I try to run the above script manually it runs. Commented Sep 14, 2020 at 18:22
  • Yes, I have set the execute bit for the script, for both user and group. Commented Sep 14, 2020 at 18:24
  • My OS is amazon linux 2. The cronjob is for the default user of amazon ec2 instance. Commented Sep 14, 2020 at 18:26

0

You must log in to answer this question.

Browse other questions tagged .