Backup Moodle courses in command line using MOOSH

Sometimes, you cannot backup your Moodle course because it is too big which makes the web server timeout. In that situation, backing up the course using command line is a good way to go. MOOSH will help you perfectly.

1. Install MOOSH in your Ubuntu server:

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

2. Go to moodle installation folder and run this command:

$ moosh -n course-backup -f /path/to/where/you/store/backup/mycourse.mbz <course_id>