0

I just made a LAMP install and got SFTP working. My question now is: How do I set up cronjobs on Ubuntu server?

I need to make some cronjobs for my PHP/MySQL application. I look for un-activated users in my MySQL table, delete them, etc.

1

1 Answer 1

0

The easiest way that keeps all the code together is to create a web script (authenticated by some "secret", so random people can't call it for you) and call it from cron using:

wget -O - http://<yoursite>/cron.php?secret=<mybigsecret>

Then you need to add a cron entry (either using crontab -e), or just placing a file into:

/etc/cron.d/

with following contents:

0 3 * * * nobody wget -O - http://yoursite/cron.php?secret=<mybigsecret>

This will call the script every day at 03:00, for more information on crontab files syntax please consult crontab(5) man page (e.g. run "man 5 crontab").

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .