Course backup unfinished

Re: Course backup unfinished

by Amir Mohammadi -
Number of replies: 1
when i enter this command : php automated_backups.php

this message will show:

PHP Warning: Module 'zip' already loaded in Unknown on line 0
Could not open input file: automated_backups.php

but i just change digits and did'nt remove M
my server is cent os 7

My backup directory is /var/www/BACKUP and every courses backed up in this directory


In reply to Amir Mohammadi

Re: Course backup unfinished

by Ken Task -
Picture of Particularly helpful Moodlers

From what directory did you issue the command:

php automated_backups.php

For any of the moodle cli scripts to work one must be in the moodle code directory.

So ... **example** ... if moodle code was in /var/www/html/

cd /var/www/html/

php admin/cli/automated_backups.php

Reason ... the CLI scripts reads variables in config.php of Moodle.

** Read the Docs **:

https://docs.moodle.org/37/en/Course_backup

https://docs.moodle.org/37/en/Automated_course_backup

From your screen shot of where you storing backups, I'd say none of the course backups have completed successfully.  Backup files in Moodle end with .mbz.

Example of a M34 version using autobackups to designated directory outside of apache:

/home/backup/m34/courses

[root@sos courses]# ls -l *2019*
-rw-rw-rw-. 1 root root    2768323 Feb 19  2019 backup-moodle2-course-2-sa-20190219-1555.mbz
-rw-rw-rw-. 1 root root    3871679 Feb 19  2019 backup-moodle2-course-3-test-20190219-1553.mbz
-rw-rw-rw-. 1 root root   23624714 Feb 19  2019 backup-moodle2-course-4-mshare-20190219-1554.mbz
-rw-rw-rw-. 1 root root    1217811 Feb 19  2019 backup-moodle2-course-5-slcentos-20190219-1554.mbz
-rw-rw-rw-. 1 root root 1260971342 Feb 19  2019 backup-moodle2-course-6-gte_complete-20190219-1554.mbz

Also, this warning ... 'PHP Warning: Module 'zip' already loaded in Unknown on line 0'

relates to php extensions ... php extensions need to be loaded only once.  Above error indicates an issue with PHP extensions ... in particular, php-zip

As root user, issue php -m [ENTER]

You should see a long listing of php info ... and towards the bottom:

zip
zlib

[Zend Modules]
Zend OPcache

PHP on CentOS 7 loads extensions from ini files in /etc/php.d/

in that directory should be only **one** ini file for zip:

from /etc/php.d/ directory:

[root@sos php.d]# ls -l zip.*

should show only:

-rw-r--r--. 1 root root 47 Oct 26 05:50 zip.ini

and zip.ini should show:

; Enable zip extension module
extension=zip.so

enabling the zip extension.

Strongly suggest finding some tutorial on administering a CentOS 7 server.  Google for that! smile

'SoS', Ken