50 lines
1.3 KiB
Markdown
50 lines
1.3 KiB
Markdown
# Backup utilities for databases
|
|
|
|
## Summary
|
|
Linux backup utilities for the following databases.
|
|
- MariaDB / MySQL
|
|
- https://git.gresse.net/Ops/Backup/raw/branch/main/mysql_backup.sh
|
|
- PostgreSQL
|
|
- https://git.gresse.net/Ops/Backup/raw/branch/main/pg_backup.sh
|
|
|
|
## How to install
|
|
|
|
### Install online
|
|
|
|
Install Utility to '/tmp/backup' direcotry with curl
|
|
```bash
|
|
curl https://git.gresse.net/Ops/Backup/raw/branch/main/mysql_backup.sh | sh -s installonline
|
|
```
|
|
|
|
Or install Utility to '/tmp/backup' direcotry with wget
|
|
```bash
|
|
wget -O - https://raw.githubusercontent.com/PierNola/BackupPg/main/backup.sh | sh -s installonline
|
|
```
|
|
|
|
### Install online in a specific directory
|
|
|
|
```bash
|
|
curl https://raw.githubusercontent.com/PierNola/BackupPg/main/backup.sh | sh -s installonline <customdir>
|
|
```
|
|
|
|
Or:
|
|
|
|
```bash
|
|
wget -O - https://raw.githubusercontent.com/PierNola/BackupPg/main/backup.sh | sh -s installonline <customdir>
|
|
```
|
|
|
|
### Install description
|
|
The installer will perform 3 actions:
|
|
|
|
1. Create and copy `backup.sh` to `/opt/backup` or to a specific directory
|
|
2. Create 3 subdirectory :
|
|
- `archive` which contains archived dumps
|
|
- `data` which contains the dumps of the day
|
|
- `log` which contains the logs
|
|
3. Create daily cron job to for daily backup.
|
|
|
|
Cron entry example:
|
|
|
|
```bash
|
|
30 22 * * * /opt/backup/backup.sh --run > /dev/null
|
|
```
|