Skip to content

Commit

Permalink
logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
keithhubner committed May 9, 2024
1 parent b986dea commit eb616c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backup_script.sh
Expand Up @@ -8,7 +8,7 @@ for var in "${env_vars[@]}"
do
if [ -z "${!var}" ]; then
echo "$var is not set. Exiting..."
exit 1
exit 0
fi
done

Expand Down Expand Up @@ -38,11 +38,11 @@ mkdir -p "$APP_DIR"
mkdir -p "$APP_DIR/backups"
mkdir -p "$APP_DIR/logs"
echo "Backup directory created successfully."
LOGFILE="$APP_DIR/logs/backup-$TIMESTAMP.log"
# create log file
touch "$LOGFILE" || { echo "Cannot write to $LOGFILE"; exit 1; }
echo "Log file: $LOGFILE"

LOGFILE="$APP_DIR/logs/backup-$TIMESTAMP.log"
BACKUP_FILE="$APP_DIR/backups/$DB_NAME-$TIMESTAMP.sql"

# Current date in seconds
Expand Down

0 comments on commit eb616c5

Please sign in to comment.