Wp-cli

Well Dreamhost sometime ago installed wp-cli [1] on their machines think of it like drush [2] and it’s really fast and nice, managing wp via CLI is way easier and clean, yes I’m aware that for sometime now also there is WP multisite and other improvements but as I like to maintain my own blog and some of friends and don’t like to move have time to dig out on multi site kind of, I did some cheating installing and copying files on every release until WP added auto update, but themes and plugins still are a problem, but when wp-cli was announced as stock install on DH I implemented this little script, now I maintain like 9 blogs, but it had my life easier, of course could do better, but this one to update my blogs is fast useful and run via cron so also is automatic.

#!/bin/bash
#find worpress install
wpi="$(find -name "wp-config.php" | cut -d'/' -f3)"
path=/path/to/your/wpinstall

for i in ${wpi}
do
echo "$path/$i/"
wp --path=$path/$i core update
wp --path=$path/$i theme update --all
wp --path=$path/$i plugin update --all

done

As you can see this is a hack to update WP, themes, and plugins automatically, from a crontab that runs weekly. In the current form as is a quick fix, I need $path to install and also from $wpi I get which directories actually are WordPress as also had static archives of older blogs and other stuff, most probably can work both paths from only one var, but as it works for me, «if ain’t broke, you don’t fix it».

[1] http://wp-cli.org/
[2] http://www.drush.org/en/master/

Esta entrada ha sido publicada en General, planetalinux, sysadmin, Web y etiquetada como , , , , , , . Guarda el enlace permanente.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.