Backup WordPress site using Dropbox and wp-cli ?

Here is how you can backup small site using wp-cli and dropbox.

Go to:

Create new app call it anything it’s gonna be your private app.

Generated access token and save it somewhere in your locker 🙂

Download file and change directories path and DROPBOX_TOKEN

sudo chmod +x

Setup crontab with crontab -e add following line there

0 5 * * * /root/ > /dev/null 2>&1

This will backup site everyday at 5 am.


  • This scripts assumes your installation will be under if not it’s time to fork this and modify script.
  • This will backup your WP tables and wp-content folder.
  • You can also change path of
  • You should clean up your dropbox folder before you run out of memory.
  • Modify crontab if you want to change backup interval to less frequent or more frequent.


Leave a Reply

Your email address will not be published. Required fields are marked *