Last active
January 6, 2020 08:36
-
-
Save CedricL46/8147ed8ff2c708b02f5281851b491541 to your computer and use it in GitHub Desktop.
See full tutorial here : https://cedricleruth.com/how-to-update-wordpress-core-version-from-unix-command-line-cli/
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
#Your First need to install wordpress cli as describe : https://wp-cli.org/ | |
#Try running | |
wp help | |
#and if you get an error run the following : | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
php wp-cli.phar --info | |
#Should display system informations | |
#If there is no errors make it executable and move it to path : | |
chmod +x wp-cli.phar | |
sudo mv wp-cli.phar /usr/local/bin/wp | |
#You should now be able to run : | |
wp help | |
#Now that we have wp cli we can use it to update wordpress from command line | |
#You first need to know your wordpress installation path | |
locate wp-config.php | |
#e.g : /var/www/html/wp-config.php | |
#Then run the update command with the installation path you got above | |
wp core update --path='/var/www/html/' | |
#Success: WordPress is up to date. | |
#Bonus: you can then add it to your unix cron to be run once a week as follow : | |
sudo crontab -e | |
#paste the following in a new line | |
30 5 * * 3 wp core update --path='/var/www/html/' | |
#wq! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment