20f734d54a
- Update app name across all files (manifest, index.html, README, docs) - Update contact email to evershelfproject@gmail.com - Rename Docker service/container/volume to evershelf - Rename localStorage keys: dispensa_* → evershelf_* - Rename SQLite DB reference: dispensa.db → evershelf.db - Update SSH remote to dadaloop82/EverShelf - Update Apache conf file name to evershelf.conf - Update CI workflow Docker image/container names - Update cron job example path - Add data/dispensa.db to .gitignore to prevent accidental commit
24 lines
638 B
Bash
Executable File
24 lines
638 B
Bash
Executable File
#!/bin/bash
|
|
# Daily backup of EverShelf database (local only)
|
|
# The database is NOT pushed to remote repositories.
|
|
# Runs via cron: creates a local timestamped backup copy
|
|
#
|
|
# Example crontab entry:
|
|
# 0 3 * * * /var/www/html/evershelf/backup.sh
|
|
|
|
INSTALL_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
BACKUP_DIR="${INSTALL_DIR}/data/backups"
|
|
|
|
mkdir -p "$BACKUP_DIR"
|
|
|
|
DB_FILE="${INSTALL_DIR}/data/evershelf.db"
|
|
if [ ! -f "$DB_FILE" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
DATE=$(date '+%Y-%m-%d_%H%M')
|
|
cp "$DB_FILE" "${BACKUP_DIR}/evershelf_${DATE}.db"
|
|
|
|
# Keep only the last 7 backups
|
|
ls -t "${BACKUP_DIR}"/evershelf_*.db 2>/dev/null | tail -n +8 | xargs -r rm --
|