moosh icon indicating copy to clipboard operation
moosh copied to clipboard

most commands unavailable on new install

Open justinhunt opened this issue 3 years ago • 12 comments

Moosh is great. I use it on some of my sites, and its always a rock. But today on a new install I can not get it to work. I might be doing something dumb ...

  • moosh version: -Reports as 1.0.0

  • moodle version: Moodle 3.8.7

  • database: mariadb

  • php version: PHP 7.1.0

  • operating system:

  • Ubuntu 16.04.5 LTS

Actual behaviour

Most commands such as : moosh course-backup 5 .. fail with "No command provided."

Only about 20 commands are listed in: --list-commands Those seem to work. I am running commands from root of Moodle dir

Expected behaviour

moosh course-backup 5 should commence a course backup

Steps to reproduce

This occurred on a new install of Moodle when I installed using these commands (from moosh-online.org) sudo apt-add-repository 'deb http://ppa.launchpad.net/zabuch/ppa/ubuntu trusty main' sudo apt-get update sudo apt-get install moosh

justinhunt avatar Mar 31 '21 07:03 justinhunt

Hi, please try to install this package manually: https://launchpad.net/~zabuch/+archive/ubuntu/ppa/+files/moosh_0.39-1_all.deb

I have split moosh into 2 versions, the 1.x one is for Moodle 3.9 and above - I need to update the documentation.

tmuras avatar Mar 31 '21 07:03 tmuras

Aha. Thanks for the fast reply. That really helped. I bit the bullet and upgraded to Moodle 39. Then it worked fine. Really appreciate your help.

justinhunt avatar Mar 31 '21 09:03 justinhunt

I don't suppose there is a nice easy way to have both versions installed on a system and switch between the two?

Most days I'm bouncing around between customers that are using a range of different Moodle versions and Totara (which is still mostly compatible with Moodle 3.4 stuff) - it's a bit awkward if I have to do a manual reinstall every time I switch to a different customer.

davosmith avatar Apr 01 '21 13:04 davosmith

It's actually very simple @davosmith - download both versions from https://moodle.org/plugins/pluginversions.php?id=522 , unzip them into (say) /home/davo/moosh0 and /home/davo/moosh1. Then run different moosh versions using full path, like: /home/davo/moosh0/moosh.php /home/davo/moosh1/moosh.php

If there are any conflicts, uninstall system (deb) version.

tmuras avatar Apr 02 '21 17:04 tmuras

Belated thanks @tmuras - I tested this the other day and it is working great.

davosmith avatar Apr 16 '21 15:04 davosmith

Install using

sudo apt-get install software-properties-common 
 sudo apt-add-repository ppa:zabuch/ppa
 sudo apt-get update
 sudo apt-get install moosh

And most commands are not available. Link mentioned above not found and outdated.

sam-suresh avatar Dec 07 '21 05:12 sam-suresh

Download and extract version 0.3x to somewhere in server. Add a symlink to path and its working.

sam-suresh avatar Dec 08 '21 00:12 sam-suresh

Is this still the only possible solution? I'm using Moodle 4.0 and I'm a bit confused since the current stable version supports only some of commands listed in the docs (restore course is not among those).

Should I try to work with unsupported and outdated version?

bmuczynski avatar Sep 30 '22 14:09 bmuczynski

Sorry to necropost, but for anyone else finding this: run the moosh command after you have changed to your moodle directory - it will display all of the commands. When you run it from somewhere else, I guess it doesn't detect the moodle install and only shows those 20 or so commands. Alternately, use the -p parameter and it will properly display all of the commands for you.

therealjeremycole avatar Apr 06 '23 23:04 therealjeremycole

I still can't get this to work. Tried all of the above, but when I'm trying to run something like:

moosh course-backup --fullbackup 22745

I get this:

_moosh version 1.14 No command provided, possible commands: apache-parse-extendedlog apache-parse-missing-files apache-parse-perflog backup-info base-path code-check download-moodle fontawesome-refreshcache framework-import generate-cfg generate-moosh lang-compare lang-stats languages-update log-analyse nginx-parse-extendedlog perf-analyse plugin-download plugin-install plugin-list plugin-uninstall report-concurrency top Global options: -v, --verbose be verbose

    -p, --moodle-path=
            Moodle directory.

    -u, --user=
            Moodle user, by default ADMIN

    -n, --no-user-check
            Don't check if Moodle data is owned by the user running script

    -t, --performance
            Show performance infomation including timings

    -h, --help
            Show global help.

    --list-commands
            Show all possible commands_

Richardvi avatar Jan 04 '24 08:01 Richardvi

Try:

moosh -p "/var/www/moodle" course-backup --fullbackup 22745

(replacing /var/www/moodle with the path to where your Moodle files are)

therealjeremycole avatar Jan 04 '24 17:01 therealjeremycole

Thanks, that worked!

Richardvi avatar Jan 05 '24 10:01 Richardvi