If you are a Textdrive user, and you have one or more WordPress installations under your control, you might find the following BASH script to be of use. The script is fairly straightforward in that it manages the backup of your existing WordPress installation and database to StrongSpace, then it automatically downloads and extracts the latest version of WordPress.

Notes:

  • If you do not have a StrongSpace account, then you will need to modify the script to change the safe storage of backups.
  • To take advantage of StrongSpace, you need to get the relevant SSH keys in place on both servers in order to be able to log into your StrongSpace account over SSH without a password.
  • Ensure that you have created both the updates and backups directories on your Textdrive account
  • WordPress has an upgrade script that sometimes needs to be run after the system software has been updated. This upgrade script may contain more than one step, and require confirmations or input from the administrator. For these reasons, I have not included that step in the automation script. Make sure you check to verify that the upgrade script is run if necessary.

The Script:

Liquid error: POSIX::Spawn::TimeoutExceeded

Save all of that into /users/home/username/scripts, and replace all of the configuration options with your own parameters. You should probably be comfortable using the CLI before you start tinkering with this sort of thing - I'm not responsible for any fuckups on your part. Once you are happy with the script, all you need do is run it, and if all goes well, your installation will be backed up and updated all at once!

Check to make sure that you don't need to run the upgrade script (run it if you do), and then you should be finished!

I'm going to post more information relating to getting your Textdrive account working with your StrongSpace account soon - particularly with regards to automating backups.