2011년 9월 7일 수요일

How to configure for BackUp System

For making our system safe, I've configured Backup system.
What I did is that use two hard disk, 1 is internal and other is USB hard disk.
1. Mounting each HDD to our system.
Command is,
   # mkdir /HDD2
   # sudo mount /dev/sdb /HDD2

     Making 2 Partitions
  # sudo /sbin/fdisk /dev/sdc

    Formatting HDD
  # sudo mkfs.ext4 /dev/sdc1
  # sudo mkfs.ext4 /dev/sdc2

  # mkdir /HDD3
  # sudo mount /dev/sdc1 /HDD3

after that, I add that in /etc/fatab to mount automatically.


2. Using 'rsync' to make same directory to '/var/www/moodle' and '/var/moodledata'.
    Command is,
    # rsync -av /var/www/moodle /HDD2/BackUP/backup_moodle
    # rsync -av /var/moodledata/ /HDD2/BackUp/backup_moodledata

    and using mysqldump to backup database
    # sudo mysqldump -h localhost -u root --password=KUelearning -C -Q -e --create-options moodle > /HDD2/BackUp/moodle-database.sql

3. Adding above commands to crontab; scheduling 

2011년 9월 6일 화요일

In moodledata directory, you should change permission for filedir, temp to backup!!

I got error when I was trying to backup of moodle
The error message was 'can not write, no writable permission'

I solved that problem using this command,

# chmod -R 777 /var/moodledata/filedir
# chmod -R 777 /var/moodledata/temp

That's all

How to use 'e-Mail Notification & cron.php '

I have been trying to find out how to use 'e-Mail Notification on moodle'.
Finally, I've found out that.
Let me describe about that,

-  e-Mail Notification is working when cron.php is working.
1. You need to configure 'crontab' to use cron scheduling.
    in command line,
    # sudo crontab -e -u root

2. Choose editor whatever you want

3. add this line,

    min hour day month week  command

    */2 * * * * php /var/www/moodle/admin/cli/cron.php

4. Restart cron,
    # sudo /etc/init.d/cron restart

that's all