Automatic nightly WordPress updates CHECK with WP-CLI plugins

Hello, I’m Takeken.

I’m pretty hardly at a mail check on the morning, but this adds one to WordPress plugins WP-CLI !!

WP-CLI is very nice plugins that It’s checked WordPress Core, WordPress Theme, WordPress plugins , It is a very good WordPress plugins for me who do not use the Auto-Update system.

good.

Well, let see to how to install.

References:

http://wp-cli.org/

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

 

All systems go ?


Ok. And so, let’s create a script.

vim wpcheck.sh

#!/bin/sh

MAIL_TO="YOUR MAIL"
HOST_NAME="YOUR HOSTNAME"

Version=`/usr/local/bin/wp core check-update --path=/pathto/wordpress`
Plugins=`/usr/local/bin/wp plugin status --path=/pathto/wordpress`
Theme=`/usr/local/bin/wp theme status --path=/pathto/wordpress`

echo "$Version $Plugins $Theme" | mail -s "Wordpress Plugins CHECK $HOST_NAME" $MAIL_TO

Are you ready ?

Execute the command:
sh wpcheck.sh

Such an email comes.. Maybe.

Subjects: WordPress Plugins CHECK ******

Success: WordPress is at the latest version. 4 installed plugins:
  A moji-changer       1.0.0
  I akismet            3.1.3
  I hello              1.6
  I wp-multibyte-patch 2.4

Legend: A = Active, I = Inactive 3 installed themes:
  A twentyfifteen  1.3
  I twentyfourteen 1.5
  I twentythirteen 1.6

Legend: A = Active, I = Inactive

 

Have you received text?

You can use it if you WordPress Update does at myself want.
If you should need any help, just let it use.

Say now, I remember!

Let’s enroll in cron.

crontab -e

Exam:

# wordpress plugins check
0 5 * * * /bin/sh /home/takeken/wordpress_update_check.sh

it’ll result come to you. receive at five o’clock.

References:

http://wp-cli.org/

https://github.com/wp-cli/wp-cli

Related Posts


投稿者: Takeken

インターネット利用者のITリテラシーを向上したいという設定の2次元キャラです。 サーバー弄りからプログラミングまで手を付けた自称エッセイストなたけけんの物語。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です