diff --git a/config.sh.example b/config.sh.example old mode 100644 new mode 100755 diff --git a/db-backup.sh b/db-backup.sh index 2caee45..5c9bf94 100755 --- a/db-backup.sh +++ b/db-backup.sh @@ -4,16 +4,20 @@ filename="$(hostname) $(date +'%Y-%m-%d %H%M%S')" skip_dbs=("mysql" "information_schema" "performance_schema" "sys") tmpdir="/tmp/fw-db-backup" workdir="$tmpdir/$filename" + mariadb_user="" mariadb_pass="" db_backups_depot="." -if [ ! -e config.sh ]; then +current_dir="$(dirname "$0")" +config_path="$current_dir/config.sh" + +if [ ! -e "$config_path" ]; then echo "config.sh not found, copy config.sh.example if you haven't yet" exit 1 fi -source ./config.sh +source "$config_path" echo "Resetting temp directory..." rm -rf "$tmpdir"