I’m a great believer in automation; as one of my interviewers said to me once: If we do it twice; we automate it.
I adopted this style throughout my work; hence I wanted to show how would I upgrade/update the WordPress core and plugins using cron to keep all my blogs and sites secure and up to date with security patches.
1- get & install wp-cli
(how/where)
2- write a script to use wp-cli
to update WordPress [see attached code]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#!/bin/bash # prevent errors snowball effect : stop at any process which exit with non success value (non zero) set -e # print current version | used for logs wp core version # upgrade core and database wp core update wp core update-db # upgrade plugins wp plugin update |
Recent Comments