Backup policy

Re: Backup policy

by Matteo Scaramuccia -
Number of replies: 4
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi ALbert,

is there a way of excluding /moodledata/cache, /moodledata/localcache, /moodledata/sessions, /moodledata/temp, or /moodledata/trashdir

you may not exclude moodledata/trashdir since, by Moodle File API design, you have 4 days to automatically recycle it back into the Moodle storage: having configured cron will take care of that folder within that time range and ideally that folder will be "almost empty" on average week by week.

HTH,
Matteo

Average of ratings: Useful (2)
In reply to Matteo Scaramuccia

Re: Backup policy

by Albert Ramsbottom -

Ok, I have a little more information now, we are using enterprise MySQL which includes Enterprise backup which is incredibly quick. I mean hours to minutes over MySQLdump

We can exclude anything from the backup, so I think I need a reliable list of directories that we can exclude to get the size down. We are at 7TB at the moment and I am trying to talk the education team out of automatic courses backups. We keep 7 and they really should be turned off as I have pointed out they are not and shouldnt be part of an emergency backup policy, only full site backups should be for that

So what can I exclude?


Thanks

In reply to Albert Ramsbottom

Re: Backup policy

by Albert Ramsbottom -

Bump smile

In reply to Albert Ramsbottom

Re: Backup policy

by Conn Warwicker -
Picture of Core developers Picture of Plugin developers

Honestly, I'd look at reducing the size of that folder first. I can't imagine you have 7TB worth of stuff you actually need. I suspect you have many years worth of backups and old files in there. You could reduce that down by a significant chunk with a clear-out.



Average of ratings: Useful (1)
In reply to Albert Ramsbottom

Re: Backup policy

by Ken Task -
Picture of Particularly helpful Moodlers

Recently, lost a free resource for hosting sandbox moodles and had to go to a commercial route ... decided on Rackspace.   CentOS 7 and re-learning the diff's between CentOS 6 and 7,

Anyhoo ... also decided I needed to replicate the mounting of a Google Bucket ... 1.0P ... more storage than I'll use in my remaining years, me thinks!!!!

First, you do have to acquire a google account (doesn't have to be one from any Google for Education Domain) and a Google Bucket.   Those I'll leave out here ... but the key is mounting from any server you desire to backup.

https://www.assistanz.com/mount-google-cloud-storage-bucket-linux/

The 'key' for me get it working easily was this bit of info:

/root/.config/gcloud/application_default_credentials.json

Notice did this as root user .. which, due to nature of what one is doing, could be even safer ... devil is in the details (as always) ... the .config directory - 'dot'config.

Didn't set it up in fstab as that might stall a reboot of server IF bucket can not be mounted.
Instead have a 'mountgbucket' script in /root that mounts.

export GOOGLE_APPLICATION_CREDENTIALS=/root/.config/gcloud/application_default_credentials.json;

then

mount -t gcsfuse -o rw,allow_other,nonempty busrv /mnt/gbucket

[root@someserver ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      158G   14G  137G  10% /
busrv          1.0P     0  1.0P   0% /mnt/gbucket

Then do your scripts to backup ... this one for a moodle35

tar -cvf /mnt/gbucket/m35/moodle-code-351+-$(date +%Y%m%d%-H%M%S).tar /var/www/html/moodle35;

tar -cvf /mnt/gbucket/m35/moodle-data-351+-$(date +%Y%m%d%-H%M%S).tar /var/moodle35data;

Note that's not a minimal ... it's a full backup of moodledata

Your mysql dump to the same location on the bucket as well.

The great thing about this ... one could mount the same bucket from multiple servers ... and servers don't have to be on the same network.  Like I said above ... was on tcea.org's now moved to a RackSpace server and one should be able to do the same with any Linux/Mac flavored box.

OR ...

When done with one server, umount the bucket ... go to another server ... setup the same bucket ... create in /mnt/gbucket/ directories for the server you are on.

Run your scripts ... done ... umount ... next server.

For someone that just has to stick to GUI ... did find a commercial product ... does as advertised.

On this Mac I have and use the same mounted Google Bucket.  One can drag and drop from one mounted device to another.

Called ExpanDrive:

https://www.expandrive.com/docs/

And check out what it will do ...


IMHO, worth every dime!

Anyhoo ... thought I'd share ...

'spirit of sharing', Ken