Backup¶
We keep daily and weekly snapshots of your entire Asteroid (your home directory, DocumentRoots, and everything else on disk), mounted read-only at /backup:
[isabell@moondust ~]$ ls /backup
current daily.0 daily.1 daily.2 daily.3 daily.4 daily.5 daily.6 daily.7 weekly.1 weekly.2 weekly.3 weekly.4 weekly.5 weekly.6 weekly.7
current and daily.0 are the same as your live data. Each other daily.N/weekly.N folder is a full snapshot of your Asteroid as it was at that point in time, so you have up to a week of daily and up to seven weeks of weekly snapshots to restore from.
Your files live at the same path they normally do, just below the snapshot folder, for example:
[isabell@moondust ~]$ ls /backup/daily.3/home/isabell
Restoring files¶
Since the backup is mounted read-only, just copy the files you need back to their original location. For a single file, cp is enough:
[isabell@moondust ~]$ cp --archive /backup/daily.3/home/isabell/config.php ~/config.php
For a whole directory, use rsync instead, so you only copy what actually changed and can preview the result first. Always do a --dry-run before the real thing:
[isabell@moondust ~]$ rsync --archive --verbose --dry-run /backup/daily.3/home/isabell/my_project/ ~/my_project/
Once the dry run looks right, drop --dry-run to actually restore:
[isabell@moondust ~]$ rsync --archive --verbose /backup/daily.3/home/isabell/my_project/ ~/my_project/
Trailing slashes matter
A source path ending in / copies the contents of that directory into the destination. Without the trailing slash, rsync copies the directory itself, nesting it one level deeper than you probably want.
Databases
MariaDB and PostgreSQL are backed up separately via daily dumps. See MariaDB and PostgreSQL for details.