Read vars from external file

This commit is contained in:
root
2023-12-01 03:26:54 +00:00
parent c9874578cf
commit 70daa0e53f
3 changed files with 18 additions and 8 deletions

View File

@@ -1,10 +1,3 @@
[2023-11-25 12:00:01] Success Main PID: 16903 (mongod)
[2023-11-25 12:05:01] Success Main PID: 16903 (mongod)
[2023-11-25 12:10:02] Success Main PID: 16903 (mongod)
[2023-11-25 12:15:02] Success Main PID: 16903 (mongod)
[2023-11-25 12:20:01] Success Main PID: 16903 (mongod)
[2023-11-25 12:25:01] Success Main PID: 16903 (mongod)
[2023-11-25 12:30:01] Success Main PID: 16903 (mongod)
[2023-11-25 12:35:02] Success Main PID: 16903 (mongod)
[2023-11-25 12:40:02] Success Main PID: 16903 (mongod)
[2023-11-25 12:45:01] Success Main PID: 16903 (mongod)
@@ -1630,3 +1623,10 @@ Changed ownership of /var/run/mongodb/mongod.pid to mongod:mongod
[2023-12-01 02:40:01] Success Main PID: 3302 (mongod)
[2023-12-01 02:45:01] Success Main PID: 3302 (mongod)
[2023-12-01 02:50:02] Success Main PID: 3302 (mongod)
[2023-12-01 02:55:01] Success Main PID: 3302 (mongod)
[2023-12-01 03:00:01] Success Main PID: 3302 (mongod)
[2023-12-01 03:05:01] Success Main PID: 3302 (mongod)
[2023-12-01 03:10:02] Success Main PID: 3302 (mongod)
[2023-12-01 03:15:01] Success Main PID: 3302 (mongod)
[2023-12-01 03:20:02] Success Main PID: 3302 (mongod)
[2023-12-01 03:25:01] Success Main PID: 3302 (mongod)

View File

@@ -1 +0,0 @@
Backup folder not set. Aborting script.

View File

@@ -5,6 +5,17 @@
# BACKUP_MONGO_USER
# BACKUP_MONGO_PASSWORD
# BACKUP_MONGO_PATH
# Optionally, these variables can be specified in a separate file, config.sh instead.
# Get the directory of the script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Set the relative path to the config file
CONFIG_FILE="$SCRIPT_DIR/config.sh"
if [ -f "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
fi
mongo_host="localhost"
mongo_port="27017"