Thursday, April 25, 2019

Solution to Moodle Error: Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.

Did you ever come across the following error when you try to access Moodle,

"Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write."
This usually happens when cache files are corrupted, one probable cause can be improper shutdown of Moodle system.

Here is the solution to fix the issue.

1. Go to Moodle root directory
    #cd /var/www/html/moodle
  
2. Run the command  
   #php admin/cli/purge_caches.php

3. Go to moodledata/cache directory

  #cd /var/moodledata/cache
  
4. Remove the cache store directory, DO NOT remove of change the core_component.php file
   # rm -rf cachestore_file/

5. Refresh the Moodle Page. Its should work


Source : https://sjamso.blogspot.com/2018/08/solution-to-moodle-error-coding-error.html
Share:

Monday, April 22, 2019

Cara Backup MySQL/MariaDB Secara Otomatis di Linux

Data atau konten dari aplikasi tersimpan di database, oleh karena itu sangat penting untuk melakukan backup secara rutin. Backup di Linux dapat dilakukan secara otomatis pada waktu tertentu. Nah, di tutorial kali ini saya membahas cara backup database MySQL/MariaDB secara otomatis di Linux.

Membuat Bash Script Backup

Membuat folder backup
Membuat bash script di nano
Contoh bash script backup seperti di bawah ini, sesuaikan dengan database yang teman-teman gunakan. Backup database MySQL/MariaDB menggunakan mysqldump dan dikombinasikan dengan gzip untuk mengkompres file .sql menjadi .sql.gz. Format nama file juga ditambahkan tanggal backup, %d=day/tanggal %m=month/bulan %y=year/tahun. Hasil backup tersimpan di folder yang telah dibuat sebelumnya /root/backup/db.
Setelah membuat bash script backup aktifkan atribut X (execute).
Menguji bash script backup, jalankan bash script backup dan cek folder backup.

Menjadwalkan Backup di Cron

Setelah bash script backup dibuat, selanjutnya adalah menjadwalkan pemanggilan bash script backup secara otomatis pada waktu tertentu melalui Cron. Misalnya backup dilakukan setiap jam 24.00.
Setiap user bisa memiliki cron, pastikan cron yang disetting adalah cron milik root.
Tambahkan pada baris paling bawah.
Artikel tentang Cron baca di Crontab, Penjadwalan Secara Otomatis di Linux.
Dengan kombinasi bash script dan cron, maka database MySQL/MariaDB dapat dibackup secara otomatis.
Share: