Last active
November 15, 2018 10:58
-
-
Save jonathancraddock/8abd0d3efbf3b98cd0288c7b6f6c5d3a to your computer and use it in GitHub Desktop.
Simple script to backup a Bolt CMS install (v1.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple script to backup a Bolt CMS install | |
# v1.1 (JC) 15 November 2018 | |
# Define filenames with appended date | |
_now=$(date +"%Y_%m_%d") | |
_fileconf="bolt-backup-config_$_now.tar.gz" | |
_filedata="bolt-backup-database_$_now.tar.gz" | |
_filetheme="bolt-backup-theme_$_now.tar.gz" | |
_filefiles="bolt-backup-files_$_now.tar.gz" | |
_filefull="bolt-backup-full_$_now.tar.gz" | |
clear | |
echo BACKUP BOLT | |
echo =========== | |
echo | |
# Advice is to backup: config, database, theme, files. | |
# I'm running this script from /var/www. | |
echo "Backup config to $_fileconf..." | |
sudo tar -czf "$_fileconf" ./bolt/app/config | |
echo "Backup database to $_filedata..." | |
sudo tar -czf "$_filedata" ./bolt/app/database | |
echo "Backup theme to $_filetheme..." | |
sudo tar -czf "$_filetheme" ./bolt/public/theme | |
echo "Backup files to $_filefiles..." | |
sudo tar -czf "$_filefiles" ./bolt/public/files | |
# For completeness I'm also taking a backup of the entire Bolt subfolder. | |
# (Clear the cache before backup if you have debug set to true.) | |
echo "Backup FULL to $_filefull..." | |
sudo tar -czf "$_filefull" ./bolt | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amended with a better naming convention for the backups.