✓ Solved

Could anyone help with a cronjob problem?

Hello

Could anyone help with a cronjob problem.

This is the cronjob -
3,10,15 * * * * /bin/bash /home/admin-user/hl/bash-mysql.sh >/dev/null 2>&1

when I run this from the command line -
/bin/bash /home/admin-user/hl/bash-mysql.sh >/dev/null 2>&1

It all works, so I'm guessing it's something wrong with the crontab it's self, but I'm at loss with what's wrong.

Below is the status, which show something is running -

Jul 21 17:55:01 ML CRON[42571]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Jul 21 17:55:01 ML CRON[42570]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Jul 21 17:55:01 ML CRON[42572]: (root) CMD (/bin/bash /home/admin-user/hl/bash-mysql.sh >/dev/null 2>&1)
Jul 21 17:55:01 ML CRON[42573]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 21 17:55:01 ML CRON[42570]: pam_unix(cron:session): session closed for user root
Jul 21 17:55:01 ML CRON[42571]: pam_unix(cron:session): session closed for user root
Jul 21 18:02:01 ML cron[841]: (root) RELOAD (crontabs/root)
Jul 21 18:03:01 ML CRON[42690]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Jul 21 18:03:01 ML CRON[42691]: (root) CMD (/bin/bash /home/admin-user/hl/bash-mysql.sh >/dev/null 2>&1)
Jul 21 18:03:01 ML CRON[42690]: pam_unix(cron:session): session closed for user root

Any help would be appreciated.

Thanks

1 Reply

✓ Best Answer

This has now been solved -

I needed to sue /etc/crontab instead of crontab -e

Thanks

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct