by Ken Task.
Oops .... the following a correction/addition for https://moodle.org/mod/forum/discuss.php?d=256830#p1113889
the last command in the example above for updating a site ...
after php admin/cli/purge_caches.php
one should issue:
php admin/cli/maintenance.php --disable
That takes site out of maintenance mode - otherwise, no one can login ... not even admin level users.
'spirit of sharing', Ken