2015/04/21
							
							Scripted WordPress Upgrades
This command line interface for administering WordPress is called wp-cli. It’s pretty great.
I wrote a script to run from cron for updating a bunch of different WP installs in the same directory.
| 
					 1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
 | 
						#!/bin/sh 
base='/serve/www'
 
cd "$base" || { echo 'web base dir - could not change dir.' && exit 1; }
 
wpcli=`which wp`
 
[ -x "$wpcli" ] || { echo 'wp-cli not found.' && exit 2; }
 
for i in `/bin/ls | grep -v wordpress`; do
 
  if [ -f "$i"/wp-includes/version.php ]; then
 
    cd "$base/$i"
 
    $wpcli core update
 
    $wpcli theme update --all
 
    $wpcli plugin update --all
 
    cd -
 
  fi
 
done 
 | 
					
Scripted WordPress Upgrades is original content from devolve.
																						
								
								
													