| | 1 | = UoL LAMP Backups |
| | 2 | |
| | 3 | Tags: [[UoL LAMP Server]] |
| | 4 | |
| | 5 | == Server Backups |
| | 6 | |
| | 7 | The LAMP servers are backed up hourly automatically as part of the LAMP service, although no separate database back up is taken. |
| | 8 | |
| | 9 | To restore from a back up, contact the RCS Support. |
| | 10 | |
| | 11 | == Database Backups |
| | 12 | |
| | 13 | All databases are backed up daily, weekly and monthly by running the `/local/backupAllDatabases.sh` script from `wwwrun`'s crontab. The backups are stored in `daily`, `weekly` or `monthly` sub-directory in the `/local/backup` directory and zipped to save space. The most recent daily backup is also stored in the `/local/backup/Latest` directory. |
| | 14 | |
| | 15 | Backups are removed after a period of time, depending on their type: |
| | 16 | |
| | 17 | Daily:: 6 days |
| | 18 | Weekly:: 3 weeks |
| | 19 | Monthly:: 3 months |
| | 20 | |
| | 21 | === Restoring Databases |
| | 22 | |
| | 23 | 1. If the database exists, remove the database by running the command `DROP DATABASE {database name}` from the mysql command prompt. |
| | 24 | 1. Unzip the backup file by running `gunzip {database name}-{backup date}.gz` |
| | 25 | 1. Recreate the database by running the command `mysql -u {username} -p {database name}{backup date}` |
| | 26 | |
| | 27 | [[BackLinks]] |