Last active
May 28, 2018 11:05
-
-
Save sergixnet/696b4ce30d3ade3cf34f7f28a35620ba to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Creates a backup of a WordPress instalation, files and database with WP-CLI | |
# Go to the root directory | |
cd htdocs | |
# Backup files of the root site | |
tar --exclude='./.git' -czvf "backup-$(date +%Y%m%d%H%M%S).tar.gz" . | |
# Backup of the database | |
wp db export "backup-db-$(date +%Y%m%d%H%M%S).sql" | |
echo Backup files created OK | |
echo Now you should download and remove the files from the server | |
echo Bye! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment