+ Post New Thread
Results 1 to 4 of 4
Virtual Learning Platforms Thread, moodle backup on Ubuntu in Technical; Hi I am having problems getting a cron job set to backup out moodle server running ubuntu to a windows ...
  1. #1

    Join Date
    Feb 2008
    Posts
    314
    Thank Post
    51
    Thanked 2 Times in 2 Posts
    Rep Power
    13

    moodle backup on Ubuntu

    Hi

    I am having problems getting a cron job set to backup out moodle server running ubuntu to a windows share..

    Could anybody point me in the right direction?

    Thanks

  2. #2


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,657
    Thank Post
    350
    Thanked 789 Times in 710 Posts
    Rep Power
    344
    What's the problem you're having with the cron?

  3. #3
    danbuntu's Avatar
    Join Date
    Dec 2009
    Location
    Maidstone, Kent
    Posts
    284
    Thank Post
    0
    Thanked 50 Times in 47 Posts
    Rep Power
    17
    if you haven't already you might like to look at webmin which can make running some of these taksks a lot easier.

  4. #4


    Join Date
    Oct 2006
    Posts
    3,387
    Thank Post
    183
    Thanked 350 Times in 279 Posts
    Rep Power
    147
    I've just so happened to set up backups last week. Heres my scrips etc;

    You'll need smbclient and smbfs(?iirc) installed.

    winfp1 = the windows box which holds the backups.
    data dir = /moodledata/data
    backup dir (which is on the moodle box) = /moodledata/backups

    fstab entry to map smb share = //winfp1/Linux_Backups$/moodle /winfp1 smbfs auto,credentials=/root/.winfp1_credentials,workgroup=DOMAIN 0 0
    /root/.winfp1_credentials =
    username=user
    password=pass

    crontab
    Code:
     1 0 * * * perl /var/www/moodle/mysqldumper/msd_cron/crondump.pl -config=mysqldumper -html_output=0
      5 0 * * * /root/scripts/compress
      0 6 * * 0 /root/scripts/weekly
      0 8 * * * /root/scripts/dailypurge
    Ive used an app called mysqldumper, heres the script it outputs to backup the BD
    Code:
    perl /var/www/moodle/mysqldumper/msd_cron/crondump.pl -config=mysqldumper -html_output=0

    Ive used 7zip to compress the data, then it all gets copied to the daily folder
    compress
    Code:
    7za a -t7z -mx9 -mmt /moodledata/backups/data/daily/moodledata_`date +%Y_%m_%d`.7z /moodledata/data/
    cp /moodledata/backups/data/daily/moodledata_`date +%Y_%m_%d`.7z /winfp1/data/daily/
    cp /moodledata/backups/sql/moodb_`date +%Y_%m_%d`* /winfp1/sql/

    On a weekend after the backup has run it then copies that backup to the weekly folder
    weekly
    Code:
    cp /moodledata/backups/data/daily/moodledata_`date +%Y_%m_%d`* /moodledata/backups/data/weekly/
    cp /moodledata/backups/data/daily/moodledata_`date +%Y_%m_%d`* /winfp1/data/weekly/
    This script then prunes the backups so that you keep only a weeks worth of daily backups and a years worth of weekly.
    dailypurge
    Code:
    find /moodledata/backups/data/daily* -mtime +7 -exec rm {} \;
    find /winfp1/data/daily* -mtime +7 -exec rm {} \;
    find /moodledata/backups/data/weekly* -mtime +370 -exec rm {} \;
    find /winfp1/data/weekly* -mtime +370 -exec rm {} \;
    Last edited by j17sparky; 11th October 2010 at 03:19 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Ubuntu 9.10 (moodle)
    By itgeek in forum Virtual Learning Platforms
    Replies: 5
    Last Post: 1st April 2011, 04:56 PM
  2. Ubuntu 9.10 (moodle)
    By itgeek in forum Virtual Learning Platforms
    Replies: 3
    Last Post: 19th March 2010, 09:13 AM
  3. [Ubuntu] Backup Exec on Ubuntu
    By ind1ekid in forum *nix
    Replies: 3
    Last Post: 30th October 2009, 03:21 PM
  4. Acer Backup & Ubuntu
    By karldenton in forum Netbooks, PDA and Phones
    Replies: 2
    Last Post: 30th September 2009, 01:26 AM
  5. ubuntu and Moodle
    By TechMonkey in forum *nix
    Replies: 12
    Last Post: 23rd September 2006, 06:58 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •