1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-07-13 23:14:38 +03:00

Switch from zip to tar.xz (#6)

**README.md**
- Minor text change.

**Dockerfile**
- Remove installation of `zip`.
- Add installation if `xz`.

**backup.sh**
- Switch to `tar.xz` archive _(`zip` was messing up permissions)_.
- `echo` when backups start and end.
This commit is contained in:
jmqm
2021-05-26 00:11:57 -05:00
committed by GitHub
parent ae779ce6e5
commit 6974723efe
3 changed files with 33 additions and 30 deletions

View File

@ -1,14 +1,20 @@
#!/bin/sh
cd /
# Create variable for new backup zip.
BACKUP_ZIP=/backups/$(date "+%F_%H.%M.%S").zip
# Store current date in a variable.
TIMESTAMP=$(date "+%F_%H-%M-%S")
# Create variables for the files and directories to be zipped.
# Store new backup archive location in a variable.
BACKUP_LOCATION=/backups/$TIMESTAMP.tar.xz
# Create variables for the files and directories to be archived.
BACKUP_DB=db.sqlite3 # file
BACKUP_RSA=rsa_key* # files
BACKUP_CONFIG=config.json # file
BACKUP_ATTACHMENTS=attachments # directory
BACKUP_SENDS=sends # directory
# Create a zip of the files and directories.
cd /data && zip -r $BACKUP_ZIP $BACKUP_DB $BACKUP_RSA $BACKUP_CONFIG $BACKUP_ATTACHMENTS $BACKUP_SENDS && cd ..
# Create an archive of the files and directories.
echo "Starting backup at ${TIMESTAMP}..."
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}."