Skip to content

Commit fcbbb89

Browse files
fix code rabbit comments
1 parent 4a8090d commit fcbbb89

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

devops/linux/docker/backup_restore/dgraph-backup-api.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
set -e
44
set -u
55
pushd .
6+
if [ -z "$1" ]; then
7+
echo "Error: No backup folder name provided."
8+
echo "Usage: $0 <backup_folder_name>"
9+
exit 1
10+
fi
611
BACKUP_DATE_TIME=$1
712
SCRIPT_DIR=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
813
cd "${SCRIPT_DIR}/.." || exit

devops/linux/docker/backup_restore/dgraph-restore-api.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22
source ../conf.env
33
#Backup Folder Name
4+
if [ -z "$1" ]; then
5+
echo "Error: No backup folder name provided."
6+
echo "Usage: $0 <backup_folder_name>"
7+
exit 1
8+
fi
49
BACKUP_FOLDER_NAME=$1
510
SCRIPT_DIR=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
611
cd ${SCRIPT_DIR}/..

devops/linux/docker/backup_restore/postgres-backup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22
source ../conf.env
33
# Load Database Credentials from Environment Variables
4+
if [ -z "$1" ]; then
5+
echo "Error: No backup folder name provided."
6+
echo "Usage: $0 <backup_folder_name>"
7+
exit 1
8+
fi
49
if [ -z "$1" ]; then
510
# Argument is empty, so set current datetime
611
BACKUP_DATE_TIME=$(date +%Y%m%d_%H%M%S)

devops/linux/docker/backup_restore/postgres-restore.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22
source ../conf.env
3+
if [ -z "$1" ]; then
4+
echo "Error: No backup folder name provided."
5+
echo "Usage: $0 <backup_folder_name>"
6+
exit 1
7+
fi
38
BACKUP_FOLDER_NAME=$1
49

510
# PostgreSQL settings from environment variables

devops/linux/docker/backup_restore/restore-dgraph-postgres.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
source ../conf.env
33
#Backup Folder Name
44
SCRIPT_DIR=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
5-
cd ${SCRIPT_DIR}/..
5+
cd ${SCRIPT_DIR}/.. || exit
66
JEMPI_DOCKER_HOME=$PWD
77
# JEMPI_HOME = $1
88
down_dir="$JEMPI_DOCKER_HOME/deployment/down"
@@ -16,10 +16,10 @@ python_cmd=$(which python3 || which python)
1616
echo $python_cmd
1717
Function to stop services
1818
stop_services() {
19-
pushd "$down_dir"
19+
pushd "$down_dir" || exit
2020
echo "Stopping API service"
2121
source d-stack-stop-services.sh
22-
popd
22+
popd || exit
2323
}
2424
start_services() {
2525
pushd "$reboot_dir" || exit

0 commit comments

Comments
 (0)