I’m quite the fan of WordPress. It has its faults, but it’s extremely easy to get going with. Unfortunately, one of the biggest issues is getting the permissions set up correctly.
In order to speed up this process, I’ve written a script which you can run on your server to automatically set things up the way they should be.
It’s a simple bash script which requires a little configuration. Once you’ve added in the right values for the owner/group of WordPress you’re good to go and should be able to run it.
Let’s get cracking!
Having a reliable WordPress system backup is important, having it outside the application is even more so. Combine that with full control and we have something pretty awesome going on.
The file structure I like to have is:
www/ backups/ <-- Backup location html/ <-- WordPress location scripts/ backup.sh <-- This file
And we will create the backup.sh script. This assumes that you have the WP CLI and tar utilities installed.