Skip to content

Commit 081e8f0

Browse files
committed
CHANGELOG, README update
Added check if mysql-client (mysql,mysqldump) is installed
1 parent 677d666 commit 081e8f0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Check if mysql and mysqldump are installed
10+
811

912
## [1.0.0] - 2018-04-07
1013
### Added

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# sql-backup
2+
[![Maintainability](https://api.codeclimate.com/v1/badges/9af0b964df176436608d/maintainability)](https://codeclimate.com/github/williamdes/sql-backup/maintainability)
3+
24
Backup your MySQL server ( data, users, grants, views, triggers, routines, events )
35

46
## Install

backup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ set +o allexport
88
eval "$DOTENV_SHELL_LOADER_SAVED_OPTS"
99
unset DOTENV_SHELL_LOADER_SAVED_OPTS
1010

11+
if ! [ -x "$(command -v mysql)" ]; then
12+
echo 'Error: mysql is not installed !, apt-get install -y mysql-client' >&2
13+
exit 1
14+
fi
15+
16+
if ! [ -x "$(command -v mysqldump)" ]; then
17+
echo 'Error: mysqldump is not installed !, apt-get install -y mysql-client' >&2
18+
exit 1
19+
fi
20+
1121
if [ -z "${BACKUP_DIR}" ]; then
1222
echo "Empty Variable BACKUP_DIR"
1323
exit 1

0 commit comments

Comments
 (0)