Question

How to setup cron jobs in ubuntu + nginx?

I want to send schedule based php script…


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You can do this to run command every midnight: <br> <br>crontab -e (This opens the crontab editor) <br> <br>0 0 * * * your_command_here >/dev/null 2>&1 <br> <br>This will run your specified command at 12 AM midnight according to local server time.

Kamal, I’m confusing now. my url is working fine via CLI. Eg: http://mydomain.com/cron/sendEmail. I tested in cmd. Now I want to run this url everyday midnight automatically. I successfully installed ubuntu and nginx only. Now what are the steps I have to do? Thanks in advance.

@farhan.sheron that solution is over engineered for a problem as simple as yours. Just add it in manually, you don’t need to code a cronjob manager in php.