Skip to content

Commit

Permalink
fix code rabbit comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantpatil1214 committed Jul 17, 2024
1 parent 4a8090d commit fcbbb89
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions devops/linux/docker/backup_restore/dgraph-backup-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
set -e
set -u
pushd .
if [ -z "$1" ]; then
echo "Error: No backup folder name provided."
echo "Usage: $0 <backup_folder_name>"
exit 1
fi
BACKUP_DATE_TIME=$1
SCRIPT_DIR=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
cd "${SCRIPT_DIR}/.." || exit
Expand Down
5 changes: 5 additions & 0 deletions devops/linux/docker/backup_restore/dgraph-restore-api.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
source ../conf.env
#Backup Folder Name
if [ -z "$1" ]; then
echo "Error: No backup folder name provided."
echo "Usage: $0 <backup_folder_name>"
exit 1
fi
BACKUP_FOLDER_NAME=$1
SCRIPT_DIR=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
cd ${SCRIPT_DIR}/..
Expand Down
5 changes: 5 additions & 0 deletions devops/linux/docker/backup_restore/postgres-backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
source ../conf.env
# Load Database Credentials from Environment Variables
if [ -z "$1" ]; then
echo "Error: No backup folder name provided."
echo "Usage: $0 <backup_folder_name>"
exit 1
fi
if [ -z "$1" ]; then
# Argument is empty, so set current datetime
BACKUP_DATE_TIME=$(date +%Y%m%d_%H%M%S)
Expand Down
5 changes: 5 additions & 0 deletions devops/linux/docker/backup_restore/postgres-restore.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash
source ../conf.env
if [ -z "$1" ]; then
echo "Error: No backup folder name provided."
echo "Usage: $0 <backup_folder_name>"
exit 1
fi
BACKUP_FOLDER_NAME=$1

# PostgreSQL settings from environment variables
Expand Down
6 changes: 3 additions & 3 deletions devops/linux/docker/backup_restore/restore-dgraph-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source ../conf.env
#Backup Folder Name
SCRIPT_DIR=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
cd ${SCRIPT_DIR}/..
cd ${SCRIPT_DIR}/.. || exit
JEMPI_DOCKER_HOME=$PWD
# JEMPI_HOME = $1
down_dir="$JEMPI_DOCKER_HOME/deployment/down"
Expand All @@ -16,10 +16,10 @@ python_cmd=$(which python3 || which python)
echo $python_cmd
Function to stop services
stop_services() {
pushd "$down_dir"
pushd "$down_dir" || exit
echo "Stopping API service"
source d-stack-stop-services.sh
popd
popd || exit
}
start_services() {
pushd "$reboot_dir" || exit
Expand Down

0 comments on commit fcbbb89

Please sign in to comment.