Some answers are documented here: http://docs.moodle.org/en/Administration_via_command_line.
Backup and restore
Restore courses automatic procedure with cron ?
This discussion has been locked so you can no longer reply to it.