A simple bash script that takes a snapshot of the current WordPress directory and database. The archive will contain a database dump, and an entire archive of the current WordPress installation. Optionally, it can INCLUDE the uploads folder but this might result in a a huge archive file on large sites.
WPEB (WordPress Easy Backup) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (optionally) any later version.
Currently the plugin is depending on wp-cli By default the plugin does the following:
- Checks if wp-cli exists in
/usr/local/bin/wp
- Check is the current cwd is a WordPress install (currently prone to errors, needs fixing)
- Automatically runs a repair and optimize on the database
- Dumps the database using wp-cli (the file is usually
DBNAME
.sql) - Compresses the exported database using
bzip2
- Compresses everything in the
cwd
(in the future an exclude option will be provided) (in atar
archive) - Ignores the uploads folder in wp-content (to prevent large databases) (This is a pre-update backup script, right ?)
gzip
s everything with the best compression level.
Install with:
curl -sSL https://wpeb-installer.includes.io | bash
If you want to update the script you can use two options. Either run the same command as the install (will auto-update if needed), or use the built-in updater
wpeb --up
or
wpeb --self-update
For now, the plugin will only function if called from the main WordPress folder.
Use with:
cd /home/someuser/public_html
wpeb
[FLAGS]
--su=, --skip-uploads= yes/no (Defaults to yes, skipping uploads folder)
yes: include uploads
no: skip uploads
--ro=, --repair-optimize= yes/no (Defaults to yes, repair and optimize db)
yes: repair and optimize db
no: skip repairing and optimizing
--co=, --compression= 1-9 (Defaults to 9, compression rate)
1 - fastest (compression, largest file)
9 - best (compression, smallest file)
--of=, --output-folder= Defaults to the site's root directory.
Absolute folder path
EG: /srv/backups/
Folder will be created if it doesn't exist.
--up, --self-update Self update this script to the latest version.
Uses curl if available and fallsback to wget,
if curl is missing.
--h, --help This help screen.
Have a look at the TODO list.
WPEB (WordPress Easy Backup) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (optionally) any later version.