Usage
Usage
You can use the Remote Backup plugin to make manual backups of your data or automated backups via CLI and cron.
Creating Backups Manually
To create backups via the Control Panel, you can find the Remote Backup interface in the Utilities
section of Craft:
Here you will see a list of your recent database and volume backups as well as the ability to create new ones:
You'll see that there is some additional information listed with your backups to help you keep track of when they were last taken and from where:
- Date: the date the backup was taken.
- Time: the time the backup was taken.
- Env: the environment the backup was taken on (development, production, ...).
- Version: the Craft version running on the instance that took the backup.
- Size: the total size of the backup.
Backup Filename Formatting
Note that this information is encoded in the filenames of the files that are backed up. That means that you shouldn't manually change the name of any files that the plugin created, otherwise it will cause errors.
Automating Backups via CLI and Cron
While the interface is useful, it's generally preferred to set up automated backups on your server. Remote Backup has a number of Craft commands that let you take backups from the CLI:
- remote-backup/database Manage remote database backups
remote-backup/database/create Create a remote database backup
remote-backup/database/list List remote database backups
remote-backup/database/prune Delete old remote database backups
- remote-backup/volume Manage remote volume backups
remote-backup/volume/create Create a remote volumes backup
remote-backup/volume/list List remote volumes backups
remote-backup/volume/prune Delete old remote volume backups
For example:
./craft remote-backup/database/create
These commands can be used alongside cron or your deployment scripts to automatically/periodically create backups.
0 * * * * /path/to/craft remote-backup/database/create
5 * * * * /path/to/craft remote-backup/database/prune