This directory contains scripts and snapshots specifically designed for creating and managing the BetterShift demo environment. Do NOT use these scripts on production data as they will reset/overwrite your database.
create-snapshot.sh- Creates a snapshot of the current database state for demo purposesreset-demo.sh- Resets the database to the demo snapshot state
This folder helps maintain a consistent demo environment by:
- Capturing a pre-configured database state with sample data
- Quickly resetting to that state for demos or testing
- Ensuring reproducible demo scenarios
./demo/create-snapshot.shThis will create a snapshot of your current database in the demo folder.
./demo/reset-demo.shThis will overwrite your current database with the demo snapshot.
For automated demo environments (e.g., public demos), you can set up a cron job to automatically reset the database at regular intervals.
Example: Reset every hour
# Edit your crontab
crontab -e
# Add this line to reset every hour at minute 0
0 * * * * cd /path/to/bettershift && ./demo/reset-demo.sh >> /var/log/bettershift-demo-reset.log 2>&1Example: Reset every 30 minutes
# Add this line to reset twice per hour
*/30 * * * * cd /path/to/bettershift && ./demo/reset-demo.sh >> /var/log/bettershift-demo-reset.log 2>&1Example: Reset daily at 2 AM
# Add this line to reset once per day
0 2 * * * cd /path/to/bettershift && ./demo/reset-demo.sh >> /var/log/bettershift-demo-reset.log 2>&1Important for Cron Setup:
- Replace
/path/to/bettershiftwith your actual project path - Ensure the cron user has permission to run the script
- The script requires
sudopermissions for file operations - Check logs at
/var/log/bettershift-demo-reset.logfor errors - Consider using
flockto prevent overlapping executions:*/30 * * * * flock -n /tmp/demo-reset.lock -c "cd /path/to/bettershift && ./demo/reset-demo.sh" >> /var/log/bettershift-demo-reset.log 2>&1
- ⛔ Never run these scripts on production databases
- 🎯 This folder is exclusively for demo/testing environments
- 💾 The snapshot file is not tracked in git (see
.gitignore) - 🔄 Always backup your data before running reset scripts
If you need to backup or restore production data, use proper backup tools and strategies instead of these demo scripts. Consider:
- Database backup solutions (SQLite
.backupcommand) - File-based backups with proper versioning
- Automated backup schedules
- Secure off-site storage