Modules: Moodle module — Moodle php — Learning

Linux site backup

Description:
This script can beused to make scheduled backups of your mysql DataBases and your site folders.

Functions:
- Backup MySQL DataBase via ssh
- Synchronize folders via ssh

Requirements:
Linux, with RSYNC

Installation instructions:
Upload files to your server where you want to make backup.
Set chmod 777 to script folder and directorySQL folder.

Options:
none.

Instructions on how to use:
###SET SSH KEY###
1. Login as root
2. Create ssh key file:
ssh-keygen -t dsa
Follow the prompts, just hitting enter for the passphrase. This will yield the id_dsa.pub and id_dsa files (the public and private key pair):

…Generating public/private dsa key pair. [Enter]
…Enter file in which to save the key (/home/ross/.ssh/id_dsa): [Enter]
…Created directory ‘/home/ross/.ssh’. [Enter: you might not see this message]
…Enter passphrase (empty for no passphrase): [Enter]
…Enter same passphrase again: [Enter]
…Your identification has been saved in /home/ross/.ssh/id_dsa.
…Your public key has been saved in /home/rick/.ssh/id_dsa.pub.
3. Copy ssh public key file to the destination machine (where backup files will be copied)
ssh-copy-id -i ~/.ssh/id_dsa.pub ross@kids [or enter ip address instead of hostname, e.g."kids"]

###SET CONFIG FILE###

1. Go to script by URL.
2. Click Settings and Go to Settings page.
3. Fill the fields.
4. And click “Create config file”.
5. Config file will be created.
6. If you try to open settings page one more time, you’ll have to write your password.
7. Set cron job as root user to make_backup.php file.

2 10 * * 0 /usr/bin/php /var/www/html/backup/make_backup.php

Download:
Linux Backup


Tags: , ,

You can follow any responses to this entry through the RSS 2.0 feed.