This is a simple BookStack backup script, to dump the database, copy uploaded files, and zip it all up into a timestamped archive. This is designed for an on-system install, not a docker setup. Database credentails are automatically read from your BookStack config.
This script will copy uploads before zipping, so you'll need more free space on your system than your BookStack directory already consumes.
- Copy the script down to a file (
bookstack-backup.sh
). - Tweak the configu variables at the top of the script.
- Make the script executable (
chmod +x bookstack-backup.sh
). - Run the script (
./bookstack-backup.sh
).
did you use the bookstack-system-cli? In this case you need to put something like the date in it:
docker exec -it bookstack /app/www/bookstack-system-cli backup /sicherung/bookstack_$(date "+%Y-%m-%d_%H-%M-%S").zip
and of course a job to rotate the backups since it will fill you disk if you never clean them up ;)