WPguy WPguy - 13 days ago 4
PHP Question

Cronjob not working Ubuntu Server

I just finished setting up a cronjob on my server. I created my

cron.sh
. If I run this file via SSH with
./cron.sh
everything its fine, its working as expected.

I added a new line within
/etc/crontab
file to run the
.sh at every 5 minutes
but its not working. I can't understand why.

Line added in crontab:

*/5 * * * * /var/www/sitename/wp-content/themes/themename/cron.sh >/dev/null 2>&1


Its a Ubuntu Server. I guess i use a wrong crontab file.

I already set 777 fron cron.sh.

Any ideas? Thank you

Answer

Ubuntu prefers to use

$ crontab -e

Instead of editing the file.

This will edit the crontab for the specific user you logged in as.

Comments