You can configure a Cron Job to call Enupal Backup and automatically create a backup each night, rather than doing a manual Backup every time.
Before you begin,
- We recommend running your backups at a time of day or night when usage is low.
- Please make sure you have enough disk space on your server before proceeding.
- Could be a good idea take a look at the general settings and setup a proper amount of backups to keep locally.
Enupal Backup will enable a Webhook URL in order to be called from the Cron Job, this URL will add the backup to the Craft queue, the second Cron Job will execute the queue so the backup can be processed 1 minute later. Follow the next steps to enable this feature:
- Click on "Settings"
- Click on "Schedule"
- Enable Webhook
- Add a "Secret Key" you could automatically generate one on clicking the "Generate" link
- Save the Settings
- Copy the Cron Example
- Add the two lines copied to your crontab.
If for some reason you can't add the second cronjob line, we recommend to install the Async plugin as will executes the the Backup once is added to the queue.
# Alternatives to Cron
Some hosting companies don’t allow access to cron, but there are websites offering alternative ways of scheduling jobs (free or paid-for). Here are some examples:
However, this approach will only help for the first Cron Job (call the Webhook URL), we recommend finding a hosting that allows run Cron Jobs on your own.
Our example will execute your backup every morning at 3:11 AM.