Skip to content

Commit 454193c

Browse files
koelle25alexmv
authored andcommitted
Fix usage of date command
1 parent be5ee98 commit 454193c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

entrypoint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,17 +477,17 @@ appManagePy() {
477477
}
478478
appBackup() {
479479
echo "Starting backup process ..."
480-
if [ -d "/tmp/backup-$(date "%D-%H-%M-%S")" ]; then
481-
echo "Temporary backup folder for \"$(date "%D-%H-%M-%S")\" already exists. Aborting."
480+
if [ -d "/tmp/backup-$(date "+%D-%H-%M-%S")" ]; then
481+
echo "Temporary backup folder for \"$(date "+%D-%H-%M-%S")\" already exists. Aborting."
482482
echo "Backup process failed. Exiting."
483483
exit 1
484484
fi
485485
local BACKUP_FOLDER
486-
BACKUP_FOLDER="/tmp/backup-$(date "%D-%H-%M-%S")"
486+
BACKUP_FOLDER="/tmp/backup-$(date "+%D-%H-%M-%S")"
487487
mkdir -p "$BACKUP_FOLDER"
488488
waitingForDatabase
489489
pg_dump -h "$DB_HOST" -p "$DB_HOST_PORT" -U "$DB_USER" "$DB_NAME" > "$BACKUP_FOLDER/database-postgres.sql"
490-
tar -zcvf "$DATA_DIR/backups/backup-$(date "%D-%H-%M-%S").tar.gz" "$BACKUP_FOLDER/"
490+
tar -zcvf "$DATA_DIR/backups/backup-$(date "+%D-%H-%M-%S").tar.gz" "$BACKUP_FOLDER/"
491491
rm -r "${BACKUP_FOLDER:?}/"
492492
echo "Backup process succeeded."
493493
exit 0

0 commit comments

Comments
 (0)