https://github.com/thenets/backup
https://github.com/thenets/backup
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thenets/backup
- Owner: thenets
- Created: 2019-07-04T09:59:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-26T22:13:18.000Z (over 6 years ago)
- Last Synced: 2025-02-14T21:46:55.634Z (over 1 year ago)
- Language: Shell
- Size: 847 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# thenets backup
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fthenets%2Fbackup?ref=badge_shield)
## Requirements
- mysql-client
- postgres-client
- openssh-client
- rsync
- awk
## Config files
### Directory (SSH)
The current user must have access to the target server from SSH. Add the `key.pub` to the `authorized_keys` to allow the access.
`my-app-content.dir.ini`
```properties
# Server origin dir
SERVER_DIR=backup@1.2.3.4:/opt/app/uploads/
# Target dir to put all backup files
TARGET_DIR=/mnt/volume_backup
# Delete files older than X days
DELETE_OLDER_THAN_X_DAYS=5
# Compress subdirs
# 0 False; 1 True
COMPRESS_SUBDIR=1
# Set compression level
# 1 - low (fast)
# 9 - high (slow)
GZIP=-1
```
### MySQL
`my-database.mysql.ini`
```properties
# MySQL Params
MYSQL_HOST=mysql.example.com
MYSQL_PORT=3306
MYSQL_USER=backup
MYSQL_PASS=+voD/QvMzv821s9uJsBs/PCtdflura4Q2C4gayfAHiA=
# Target dir to put all backup files
TARGET_DIR=/mnt/volume_backup
# Delete files older than X days
DELETE_OLDER_THAN_X_DAYS=20
# Compress subdirs
# 0 False; 1 True
COMPRESS_SUBDIR=1
# Set compression level
# 1 - low (fast)
# 9 - high (slow)
GZIP=-1
```
### PostgreSQL
`my-database.postgres.ini`
```properties
# PostgreSQL Params
POSTGRES_HOST=postgres.example.com
POSTGRES_PORT=25060
POSTGRES_USER=backup
POSTGRES_PASS=LFDrtmkCwUYuLTCMwVjFmGIjKqBwOivxNyJkmRarihg=
# Target dir to put all backup files
TARGET_DIR=/mnt/volume_backup
# Delete files older than X days
DELETE_OLDER_THAN_X_DAYS=20
# Compress subdirs
# 0 False; 1 True
COMPRESS_SUBDIR=1
# Set compression level
# 1 - low (fast)
# 9 - high (slow)
GZIP=-1
```
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fthenets%2Fbackup?ref=badge_large)