diff --git a/Dockerfile b/Dockerfile index b764543..c184398 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN apk add --no-cache \ xz \ tzdata -ENV CRON_TIME "* */12 * * *" +ENV CRON_TIME "0 */12 * * *" ENV UID 100 ENV GID 100 ENV CRONFILE /etc/crontabs/root diff --git a/backup.sh b/backup.sh index f624e4e..42ec73b 100644 --- a/backup.sh +++ b/backup.sh @@ -1,11 +1,8 @@ #!/bin/sh cd / -# Store current date in a variable. -TIMESTAMP=$(date "+%F_%H-%M-%S") - # Store new backup archive location in a variable. -BACKUP_LOCATION=/backups/$TIMESTAMP.tar.xz +BACKUP_LOCATION=/backups/$(date +"%F_%H-%M-%S").tar.xz # Create variables for the files and directories to be archived. BACKUP_DB=db.sqlite3 # file @@ -15,6 +12,6 @@ BACKUP_ATTACHMENTS=attachments # directory BACKUP_SENDS=sends # directory # Create an archive of the files and directories. -echo "Starting backup at ${TIMESTAMP}..." +echo "[INFO] Starting backup at $(date +"%F %r")..." cd /data && tar -Jcf $BACKUP_LOCATION $BACKUP_DB $BACKUP_RSA $BACKUP_CONFIG $BACKUP_ATTACHMENTS $BACKUP_SENDS 2>/dev/null && cd / -echo "Backup completed at ${TIMESTAMP}." +echo "[INFO] Backup completed at $(date +"%F %r")." diff --git a/entrypoint.sh b/entrypoint.sh index f5b9047..71d3643 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,5 +29,5 @@ if [ "$(id -u)" -eq 0 ]; then exec su-exec app:app "$0" "$@" fi -echo "$(date "+%F %T") - Container started" > "$LOGFILE" +echo "[INFO] Container started at $(date +"%F %r")" > "$LOGFILE" tail -F "$LOGFILE" /app/log/cron.log