5 Second WordPress Upgrade Script – Status & Question
THIS ARTICLE IS OUT DATED. Please see: http://www.TheCodeCave.com/EasyWPUpdate for the current release.
Well I’ve gotten some good feed back from all of you. And I want to say Thanks!
I do have a new version of the script that has some improvements.
- Fixed extra directory levels in the backup
- Improved use of quotes
- Local file location did not untar the file
- Removed “verbose” from cp to make messages clearer
- $CommonRootPrefix no longer requires trailing ‘/’
- Added comment “DO NOT PUT A SLASH AFTER ANY OF THESE VARIABLES”
- Added a list of directories to backup
- Changed long backup section into a loop of the directories
- Changed to tmp directory before performing wgets
- Added a few more update steps for forward compatiblity
- Added SQL backup code
- Added Zip of backups
I’m doing local testing on these changes and will probably release this more publicly Wednesday or Thursday.
In the mean time, I would like to ask for your help.
What is the most optimized version of this line that we can come up with:
grep “define(‘DB_NAME’, ‘” wp-config.php|sed -e ‘s/define(.DB_NAME….//g’|sed -e ‘s/.); .. The name of the database//g’
That line, run from any blog directory, returns the DB_Name in a way I can pass it to MYSQLDump. It is neither, pretty, nor optimized, nor resiliant.
What is the most optimized way YOU can think of to write that bash statement?
EDIT:
SED problem is solved. Thanks to GoldFish on the #SED channel of FreeNode.
Just wondering, did you take a look at my web update script I made for this ? Thanks.. 🙂
I’m sorry Joe… “Web Update Script”? I looked at your site, your comments and for any emails from you, but I just don’t see anything yet.
If you sent it via email, perhaps you were a victim of my spam filter. I hadn’t had any false positives for a while, so I set it to automatically expunge the spam. I’ve been meaning to turn that off and watch for any false postives for a little bit more. I’ve just done that. So if you’d sent me anything. Try it again. Even if it is still marked as spam this time, it won’t be autodeleted.
Nope, I posted it on the other post. 🙂 But it can be found here: http://blog.fileville.net/upload/wpbackup.phps, I’m sure you could come up with something much better but I’d though I’d try since you helped so much getting the script working. 🙂 Thanks…
o o o o I remember that! Yes, I did look at that… Sorry.. It’s been a very long week already.
Yes, that’s kind of neat! Really, using that, you wouldn’t even need shell access to run the script. As long as you had FTP access and could put the file in a protected directory on your server (like the log directory if no where else), you can still use this script to upate your site each time… AND you get the full log. That’s really cool Joe!
Thanks!
I’ve created a second version that allows the user to view the logs and run the update script. But I haven’t uploaded it yet. 🙂