InvoiceBerry Blog

Our thoughts & tips on small businesses, freelancers and sole traders

Run PHP scripts automatically with Cron Jobs (Crontab) and Debian

Written by on October 04, 2011

1. Log into your SSH.

2. Download Lynx (if you do not already have it):
[bash]
$ apt-get install lynx
[/bash]

3. Edit your cron jobs file:
[bash]
$ crontab -e
[/bash]

4. Type the path of your PHP script you want to run into the file:
[bash]
* * * * * lynx -dump http://www.invoiceberry.com/path/to/my/script.php
[/bash]
Info: The five stars are for the minute, hour, day, week and month you want to run the script.
E.g. in our example the script is executed once every minute on every day and every week and month of the year.
If you want to run the script every day at 7:30AM you have to change it into:
[bash]
30 7 * * * lynx -dump http://www.invoiceberry.com/path/to/my/script.php
[/bash]

5. Save and exit the editor.

6. Done!

Small Business Finance 101

Download our free guide to learn the fundamentals of finance that will help make your small business more efficient and successful.


  • Ben

    I always forget these commands…Just bookmarked your page!

  • John

    Thanks, it helped alot.

Ready to start invoicing your clients with InvoiceBerry?

Sign up to our Forever Free account. Yes, it's really free.

Don't leave us yet!

Subscribe to our weekly digest!

Sign up to our newsletter to receive our weekly email digest every Friday morning and read about the best freelancing and small business articles on InvoiceBerry.

Read previous post:
How to disable the mail alert when running cron jobs (crontab)

By default you will always receive an email to your local email account whenever a cron job either does not...

Close