Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Automated Asynchronous backup - e-mail notification/summary

$
0
0
von Ken Task.  

Ok, you 'rattled my tree' ... so here is some more ... really what I do.  Your mileage might very! And it's somewhat convoluted and technical.

Linux server.   Has sendmail installed but not figured as full blown mail server.  Sendmail is really broken into 2 parts ... localhost only and the other which you do not want, receiving.
I also have a Postfix localhost only setup on same server.
Does not get mail from outside ... localhost only.
Google for "setup postfix localhost only" to see how to set that up.

Even if I had smtp setup for the moodle, the sending goes through postfix which logs ... and I can see locally what's going on.

The localhost only can send email notifications from the moodle to a localhost user.

I have a user on that system: ktask.  It can receive mail from localhost. I don't use it to send mail ... receive only. The address for that user is ktask@samefqdnasmoodleserver

That mail never leaves the server ... moodle sending directly to a local user. That mail is never blocked by spam checkers or other such.

In the moodle, that user has an admin level account - hidden and not used in other roles of the moodle.

That account does receive notifications ... notifications of a new version available as well as notifications of automated backups.

To read that mail, ssh and alpine - a text based MTA.
Have to login, then su to ktask, then launch alpine.

OR, I use Webmin for a panel and it has a tool to read local inboxes - that's graphical but not like Thunderbird/Google/whatever ... limited.  Enough to get the job done!

I can provide screen shots if I have your email address so I can send them direct.

That's the email part ... now to the actual automated process.  The setup of that doesn't allow finely tuned and exceptions.  What I mean by that ... I'd like for automated to do smaillest courses first, leaving the larger courses last.   Or, the ability to skip some all the time.   Yes, you have options you can set that supposedly, if you have the right combo will end with what you want.   I've never been that lucky for teachers sometimes do things I hadn't anticipated! (and probably never will be able to, either!).

So here's my method of madness ... don't use auto, rather, I have determine by a previous set of backup files (saved to a designated directory so I see/find them), which courses are small, medium, and large.   You'd have to make the determination as to what actual size those are ... I would consider courses in the Gig range large as well as a couple of courses in the triple digit Megbyte size, medium to be from double digit Megabytes, and small to the all the remaining.

Once I determine that, I get their course ids ... in files smallcids.txt, mediumcids.txt, largecids.txt

Those just list the course ID's ... nothing more.

I then have 3 command line scripts that loop through the cids, runs the command line course backup.php script in code/admin/cli/, and saves to the designated directory outside of moodledata.

Tested those to make sure they work via command line.

And then 'automated' by cron job - not part of moodle cron.

Those cron jobs are not every day, more like once every week, but the smalls I can run and complete easily any day of the week as well as the mediums ... start at midnight and run until completed.   The large ... start Friday midnight and hopefully will complete by Monday 8 AM.

What upsets things ... OS kernel updates .. requires reboot.

Free space is #2 ... at least once a month I go to that designed directory and remove backups from last month ... they all have date/time stamp in their name by default so command looks something like this - issued in directory where backups reside.  This is October (month 10) and I probably want to keep all of those from Sept (month 09) but NONE from Aug (month 08)

rm -fR *202508*

Something else ... I have a remote mounted Google Bucket used especially for site backups and course backups.  If you do this on a local directory, adjust ... more frequent removal ... last thing you want happen is to run out of space ... especially if your server is an all-in-one where the DB also lives.  DB servers really hate to run out of space!!!

Do you host where you could acquire a large data device and mount it?   Won't be free ... but hopefully affordable ... and to me, as admin responsible for backups, affordable is always woth it!

You also have to determine, if possible, what is prime time for your moodle server usage and set those cron jobs avoiding those times.    Hmmmm .... good luck with that ... have never got that right 100%! traurig

Ok, there ya have my maddness! :|

'SoS', Ken


Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>