mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-06-28 06:18:15 +03:00
Fix execution scheduling (#7)
**Dockerfile** - Fix `CRON_TIME`. **backup.sh** - Remove `TIMESTAMP` variable. - Change how `date` is displayed when `echo`ing.
This commit is contained in:
parent
6974723efe
commit
734956821c
@ -9,7 +9,7 @@ RUN apk add --no-cache \
|
|||||||
xz \
|
xz \
|
||||||
tzdata
|
tzdata
|
||||||
|
|
||||||
ENV CRON_TIME "* */12 * * *"
|
ENV CRON_TIME "0 */12 * * *"
|
||||||
ENV UID 100
|
ENV UID 100
|
||||||
ENV GID 100
|
ENV GID 100
|
||||||
ENV CRONFILE /etc/crontabs/root
|
ENV CRONFILE /etc/crontabs/root
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd /
|
cd /
|
||||||
|
|
||||||
# Store current date in a variable.
|
|
||||||
TIMESTAMP=$(date "+%F_%H-%M-%S")
|
|
||||||
|
|
||||||
# Store new backup archive location in a variable.
|
# 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.
|
# Create variables for the files and directories to be archived.
|
||||||
BACKUP_DB=db.sqlite3 # file
|
BACKUP_DB=db.sqlite3 # file
|
||||||
@ -15,6 +12,6 @@ BACKUP_ATTACHMENTS=attachments # directory
|
|||||||
BACKUP_SENDS=sends # directory
|
BACKUP_SENDS=sends # directory
|
||||||
|
|
||||||
# Create an archive of the files and directories.
|
# 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 /
|
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")."
|
||||||
|
@ -29,5 +29,5 @@ if [ "$(id -u)" -eq 0 ]; then
|
|||||||
exec su-exec app:app "$0" "$@"
|
exec su-exec app:app "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$(date "+%F %T") - Container started" > "$LOGFILE"
|
echo "[INFO] Container started at $(date +"%F %r")" > "$LOGFILE"
|
||||||
tail -F "$LOGFILE" /app/log/cron.log
|
tail -F "$LOGFILE" /app/log/cron.log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user