Install wp-cli as ~/bin/wp
, and change $HOME/apps/wordpress-main
to the location of your wordpress installation.
Replace $USER
with the email address to send the alert mail to (or not to deliver to the local user account)
Add this line to your crontab (use crontab -e
to change your contab)
Last active
September 1, 2016 13:56
-
-
Save vierbergenlars/7ab19c0a90171ed49535d3766279f918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 0 * * 1 bash -c 'update_check=$($HOME/bin/wp core check-update --path=$HOME/apps/wordpress-main); if [[ ! "$update_check" =~ ^Success: ]]; then echo -e "Please update wordpress to the latest version.\n$update_check"| mail $USER -s "Wordpress update"; fi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment