1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-06-28 22:58:16 +03:00

fixed permission issues

Fixes #12
This commit is contained in:
1O 2020-09-06 21:13:33 +02:00
parent 56c36b9c57
commit bc6c9b6d48
2 changed files with 13 additions and 10 deletions

View File

@ -1,8 +1,10 @@
#!/bin/sh #!/bin/sh
if [ ! -d $(dirname "$BACKUP_FILE") ] # Check if db file is accessible and exit otherwise
then if [ ! -e "$DB_FILE" ]
mkdir -p $(dirname "$BACKUP_FILE") then
echo "Database $DB_FILE not found!\nPlease check if you mounted the bitwarden_rs volume with '--volumes-from=bitwarden'"!
exit 1;
fi fi
if [ $TIMESTAMP = true ] if [ $TIMESTAMP = true ]
@ -23,4 +25,4 @@ fi
if [ ! -z $DELETE_AFTER ] && [ $DELETE_AFTER -gt 0 ] if [ ! -z $DELETE_AFTER ] && [ $DELETE_AFTER -gt 0 ]
then then
find $(dirname "$BACKUP_FILE") -name "$(basename "$BACKUP_FILE")*" -type f -mtime +$DELETE_AFTER -exec rm -f {} \; -exec echo "Deleted {} after $DELETE_AFTER days" \; find $(dirname "$BACKUP_FILE") -name "$(basename "$BACKUP_FILE")*" -type f -mtime +$DELETE_AFTER -exec rm -f {} \; -exec echo "Deleted {} after $DELETE_AFTER days" \;
fi fi

View File

@ -5,6 +5,13 @@
BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh" BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
# Preparation
if [ ! -d $(dirname "$BACKUP_FILE") ]
then
mkdir -p $(dirname "$BACKUP_FILE")
chown $UID:$GID $(dirname "$BACKUP_FILE")
fi
# For compatibility reasons # For compatibility reasons
if [ "$1" = "/backup.sh" ]; then if [ "$1" = "/backup.sh" ]; then
>&2 echo "Using /backup.sh is deprecated and will be removed in future versions! Please use \`manual\` as arugment instead" >&2 echo "Using /backup.sh is deprecated and will be removed in future versions! Please use \`manual\` as arugment instead"
@ -35,11 +42,5 @@ if [ "$(id -u)" -eq 0 ]; then
exec su-exec app:app "$0" "$@" exec su-exec app:app "$0" "$@"
fi fi
if [ ! -e "$DB_FILE" ]
then
echo "Database $DB_FILE not found!\nPlease check if you mounted the bitwarden_rs volume with '--volumes-from=bitwarden'"!
exit 1;
fi
echo "$(date "+%F %T") - Container started" > "$LOGFILE" echo "$(date "+%F %T") - Container started" > "$LOGFILE"
tail -F "$LOGFILE" /app/log/cron.log tail -F "$LOGFILE" /app/log/cron.log