I use this on Debian Squeeze Linux, so, that is its intended platform. If you have a different platform, and it's not working right, feel free to provide me with the error and the OS. My Linux knowledge is limited to CentOS, Debian, and Ubuntu, though, so, I may not be able to help you myself.
To set it up, put it wherever you want it, and grant it execution permissions. You may do so with something like this:
chmod u+x ./xf_backup.sh
chmod 700 ./xf_backup.sh
Here's what it can do:
Running it without a parameter just outputs this:
XenForo Backup Script - by Mopquill To run this script, choose one of the parameters: ./xf_backup.sh backup - to automatically back up using config ./xf_backup.sh backup-shell - to have script prompt you for database info
If the times are coming out wrong, either your timezone is not properly set, or your server time is incorrect! To set your timezone, just fill it in in the config area. You can use stuff like US/Eastern, UTC, etc.
I don't want to type all the timezones out, so, you can see all the timezones by running:
The paths for mysqldump and gzip should be detected automatically, but if you don't have them (really just gzip, because if you don't have mysql, you have a very different problem!), you'll either need to ask your host to install them, or if you have shell and the permission to install, you'll want to do one of the following:
Ubuntu, Debian, etc.
apt-get install gzip
yum install gzip
cd /path/to/my/backup/dir && ./xf_backup.sh backup
I'm sure it's not as efficient or elegant as it could be, but it's not terribly complicated, and it works well. I've zipped it to save XenForo an eensy bit of space since it's plaintext. It should still be Linux-encoded (LF only), so you shouldn't have to worry about dos2unixing it or anything.
I will be providing support for this in a limited sort of way. If you're getting errors on certain distros or something (I'm on Debian Squeeze), or if you want features added, or if something isn't working quite ideally, by all means, let me know. However, I'm not looking to teach anyone how to use shell (beyond what's already in this documentation) or write scripts, nor how to resolve dependencies or get things installed right. Basically, if it falls under actually *using* this script and nothing more, I'll try to help as best I can, provided I've got time. If it's something that falls under your duties as administrator, please don't expect much from me.
Having said that, I'm pretty nice, I'll try to help with what I can, within reason.
I'm also most definitely open to suggestions/improved code. Either way, let me know what you think. =]
Disclaimer:This script is provided with the hope that it will be useful, but there are no guarantees nor any warranty whatsoever, expressed or implied, including but not limited to implied warranties of merchantability and fitness for a particular use or purpose. Use of this script is entirely at the risk of its user.