Helps you to use Terminal Tools to perform backups. As local backups are mostly part of the sitesync modules, this module focuses mainly on remote backups.
- Add module:
git submodule add https://github.com/titledk/ttools-backups.git ttools/backups;
- Add a
Backups
environment toconfig.yml
- this is the environment that we'll be backing up to. - Make sure that servers that need to be backed up can access the
Backups
environment!
Do so by adding the server's public key to~/.ssh/authorized_keys
on the backup server - Set up a cronjob, see below
Environments:
Live:
Host: "xxx"
Sshuser: "xxx"
Repodir: "xxx"
Backups:
RemoteBackupPath: "xxx"
RemoteBackupKeep: 96
Backups:
Host: "xxx"
Repodir: "xxx"
Sshuser: "xxx"
This is a good default, using the default settings:
- every 8 hours a local backup is created, 6 are kept
- every 8 hours a remote backup is created, 24 are kept
0 4,12,20 * * * /ABSOLUTE_REPO_PATH/ttools/sitesync-core/lib/dump-current-site.sh backup Test
30 0,8,16 * * * /ABSOLUTE_REPO_PATH/ttools/backups/lib/dump-and-sync-current-site.sh Test