Hi
I have many WP sites on the server (demo site) and finding the best way to keep plugins are up to date. Can't manual check and update plugins on 20-30 sites.
The default enabled auto-upgrade feature of WP core seems not working well.
I found this post https://kitson-consulting.co.uk/blog/automatic-wordpress-updates-wp-cli-cron
I did it myself as in the tutorial but it does not work. Below are step by steps I did.
Step 1:
Create a file wp-update in /usr/local/bin with the content insde like below
#!/bin/sh
if [ $# -ne 1 ]
then
echo "Usage: $0 </path/to/wordpress/install>" >&2
exit 1
fi
if [ ! -d "$1" ]
then
echo "$1 does not appear to be a directory. Exiting." >&2
exit 2
fi
if [ ! -f "$1"/wp-config.php ]
then
echo "$1/wp-config.php does not exist. Did you specify the path to a WordPress install?" >&2
exit 3
fi
wp core update --path="$1" --quiet
wp plugin update --all --path="$1" --quiet
wp theme update --all --path="$1" --quiet
wp language core update --path="$1" --quiet
wp language plugin update --all --path="$1" --quiet
wp language theme update --all --path="$1" --quiet
chmod + x for it and chown www-data:www-data for it as well.
Step 2:
Create a cron job like this /usr/local/bin/wp-update /var/www/mywebsite.com/htdocs
and lets it run every minute to test.
Step 3:
use the command grep CRON /var/log/syslog
to track and see the cron job is running
But the plugins are not get upgrade.
Could you please advise or have a better solution to keep tons of sites up to date ?
Thank you!