mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-06-28 03:08:14 +03:00

**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.
21 lines
673 B
Bash
21 lines
673 B
Bash
#!/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
|
|
|
|
# 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 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}."
|