Skip to main content
Topic: Backups (Read 11843 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Backups

Reply #30

And while we are at it, on the gdrive side, I use a https://script.google.com to remove the oldest ones:
Code: [Select]
function FindEmptyFolders()
{
  var pageSize = 200;
  var folders = null;
  var token = null;
  var i = null;
  var thefolder_name = 'backup';
  var DeleteLimit = new Date().getTime() - 3600 * 1000 * 24 * 14;
 
  Logger.clear()
 
  var folders = DriveApp.getFoldersByName(thefolder_name);

  while (folders.hasNext()) {
    var folder = folders.next();
    // http://stackoverflow.com/questions/25749906/permanently-delete-file-from-google-drive
    var files = folder.getFiles();
    while (files.hasNext()) {
      var file = files.next();
      if (file.getDateCreated().getTime() < DeleteLimit) {
        Logger.log(file.getName());
        Drive.Files.remove(file.getId());
      }
    }
  }

  MailApp.sendEmail('myemail@gmail.com', 'Old backups script removal', Logger.getLog());
}
This one removes backups older than:
Code: [Select]
  var DeleteLimit = new Date().getTime() - 3600 * 1000 * 24 * 14;
hmm... 2 weeks I'd say (3600 1000 24 is a day worth of milliseconds, and the 14 would be the number of days).
Bugs creator.
Features destroyer.
Template killer.


Re: Backups

Reply #32

Very interesting indeed. I haven't setup mine yet. Will look into it one by one before proceeding.

Re: Backups

Reply #33

Yep, it's pretty interesting.
Bugs creator.
Features destroyer.
Template killer.

Re: Backups

Reply #34

There is an php auto backup script shared by @Jorin and improved by @emanuele if you search around the forum. Even ElkArte already has a database backup function. That (either one) can be add up as an addon to ElkArte if somebody is interested to package it. I was thinking that autotask scheduler may perform that job. The database info can be taken from Settings.php so the credentials may be dropped if it is an addon. The only thing is the secret folder / directory which I think can also be dropped IF the database is in a small size and can be easily emailed to a specified email address. But this will not be so easy and as such I don't think that I am able to do it even though I have more free time for now.

Re: Backups

Reply #35

Quote from: derived – would it be feasible to have elk do at time of install/setup and tie the file to the same admin key?
I'm not sure what you mean here, could you elaborate a bit? (Maybe in another topic if it is not related to the backup discussion.)
Bugs creator.
Features destroyer.
Template killer.


Re: Backups

Reply #37

I have databases  7 G , 130 G files (more when I hosted Nao  :D ). I needed absolutely a secure and easy solution for backups.
A software solution was not possible in my case.
Many years ago, I have found a very good Hoster. (specialized for developers).
It's a shared Host,  include many services, no options.
One is backup, on 30 days, DB, files, mails. Read only, access from ftp and ssh,  duplicated on différents servers on two différents data centers. High security.



Last Edit: February 05, 2017, 04:16:31 pm by shaitan
My Tailor is rich

Re: Backups

Reply #38

that's a very nice and complete solution for backups  ;)
sorry for my bad english

Re: Backups

Reply #39

I hesitate to talk about it. I know how difficult it is to find a good web host.
But I talked about it because I wanted to say that if you have a large volume to backup, the usual solutions are not suitable.
My Tailor is rich

Re: Backups

Reply #40

Quote from: shaitan – I have databases  7 G , 130 G files.
Ho ho... That's a lot. Google (free version) will only accommodate up to 15 G. So using LEMP + ISPConfig, I would do the discussed methods per domain basis or otherwise it won't be enough.


Re: Backups

Reply #42

I remember those days too. I got my first ahrasis at yahoo.com and at hotmail.com. I am not sure if I still have access to them though.

Re: Backups

Reply #43

Quote from: Frenzie –
Quote from: ahrasis – only accommodate up to 15 G.
Only 15 GiB? How times have changed. My first e-mail accounts were in the 5 to 10 MiB range. :P
And 150 kb of attachments max! LOL
Bugs creator.
Features destroyer.
Template killer.

Re: Backups

Reply #44

So why don´t we have a well running Mod for Backup of Elkarte, that can backup the Database and
all the files ?
Like in Wordpress the Plugin "BackupWordpress"
https://wordpress.org/plugins/backupwordpress/

Maybe someone can port this to Elkarte or anybody can post his complete scripts, that really work ?
Many thanks.