mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-07-14 19:44:35 +03:00
10
backup.sh
10
backup.sh
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -d $(dirname "$BACKUP_FILE") ]
|
||||
then
|
||||
mkdir -p $(dirname "$BACKUP_FILE")
|
||||
# Check if db file is accessible and exit otherwise
|
||||
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
|
||||
|
||||
if [ $TIMESTAMP = true ]
|
||||
@ -23,4 +25,4 @@ fi
|
||||
if [ ! -z $DELETE_AFTER ] && [ $DELETE_AFTER -gt 0 ]
|
||||
then
|
||||
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
|
||||
|
Reference in New Issue
Block a user