Skip to content

Setting up a Cronjob for Donation Page

Tadhg Boyle edited this page May 21, 2020 · 3 revisions

So you've got your Tebex or CraftingStore store all set up and ready to go. You've already synced it once and it's appearing on your website all nice and pretty. But you don't want to have to keep coming back every so often and clicking that darndable reset button? Well.. why not use Cron like it suggested?

What? You don't know how to set up a Cron job? Well just sit right there in that chair, pull up a cup of coffee and I'll guide you through the process.

Written using Ubuntu 18.04.4 LTS. The process will be similar across Linux distros.

  • Go to http://example.com/panel/core/modules/ and click on settings next to donate.

  • Click on Synchronize Donor Store.

  • This is where you get the URL you're going to need to tell Cron to run. So copy the URL that's in red there and set it off to the side in a notepad document for safekeeping. We don't want it to run away, locks and bars ain't going to help. He'll chew right through them.

  • We're going to need to login to SSH now, we'll need the root account.

  • Navigate to the cron directory

    • cd /var/spool/cron/crontabs
    • If you get a permission error, make sure you're using the root account: sudo su
  • Now use your favourite Linux text editor to edit (or create) a file called root.

    • nano root
  • You're going to create a new line at the bottom of Cron tab and you'll enter something similar to this:

    • */5 * * * * wget -O - http://example.com/addons/donate/sync.php?key=blahblahblahblahcoffeeblahblah >/dev/null 2>&1
    • You're just going to replace the URL with your own URL that you kept for safekeeping in that notepad document... What do you mean it ran away‽ You were supposed to keep that thing safe, now it's out running around... Probably ate the neighbour's dog by now...
  • In any case, just press Ctrl + O, when it asks you if you want to actually save, press Y, then press Ctrl + X to exit.

There you go, all done. Nothing else to it. It should auto-sync every 5 minutes now. Enjoy!