Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create backups of persistency #200

Closed
landauermax opened this issue Oct 16, 2020 · 11 comments · Fixed by #201
Closed

Create backups of persistency #200

landauermax opened this issue Oct 16, 2020 · 11 comments · Fixed by #201
Assignees
Labels
enhancement New feature or request
Projects

Comments

@landauermax
Copy link
Contributor

There should be a parameter for the command line that backups the persistency in regular intervals. Also, there should be a command for the remote control that saves the persistency when executed.

The persistency should be copied into a directory /var/lib/aminer/backup/yyyy-mm-dd-hh-mm-ss/...

There should also be the possibility to restore configs, by remote control, config settings, etc.

@landauermax landauermax added the enhancement New feature or request label Oct 16, 2020
@landauermax landauermax added this to To do in Aminer via automation Oct 16, 2020
@ernstleierzopf
Copy link
Contributor

ernstleierzopf commented Oct 18, 2020

I don't think it is smart or possible to reload the complete configs from an file as this happens in the aminer.py class. The program would not be stable if too many changes were made. The way to go is to restart the aminer with the old config file. Single config settings already can be changed. Restoring them is also possible by just reversing the values of the initial remote control command.

@ernstleierzopf
Copy link
Contributor

ernstleierzopf commented Oct 18, 2020

Is it ok to create a seperate folder for the backups ([persistence_dir]_backup/yyyy-mm-dd-hh-mm-ss, for exampe /var/lib/aminer_backup/yyyy-mm-dd-hh-mm-ss?
Copying a whole folder into a subfolder is problematic with most of the existing python functions.

By creating an seperate folder it is possible to use shutil.copytree().

@ernstleierzopf
Copy link
Contributor

what is the expected timespan for the backups? Currently once per day is implemented.

@landauermax
Copy link
Contributor Author

I don't think it is smart or possible to reload the complete configs from an file as this happens in the aminer.py class. The program would not be stable if too many changes were made. The way to go is to restart the aminer with the old config file. Single config settings already can be changed. Restoring them is also possible by just reversing the values of the initial remote control command.

I am not sure if I understand the comment correctly, since this issue is not about the config, but only the persisted data.

@landauermax
Copy link
Contributor Author

Is it ok to create a seperate folder for the backups ([persistence_dir]_backup/yyyy-mm-dd-hh-mm-ss, for exampe /var/lib/aminer_backup/yyyy-mm-dd-hh-mm-ss?
Copying a whole folder into a subfolder is problematic with most of the existing python functions.

By creating an seperate folder it is possible to use shutil.copytree().

I think this is what I suggested in the issue description. A separate folder that contains the persistencies, e.g., /var/lib/aminer/backup/yyyy-mm-dd-hh-mm-ss/NewMatchPathValueDetector/Default

@landauermax
Copy link
Contributor Author

what is the expected timespan for the backups? Currently once per day is implemented.

Probably depends on the application case, but yes, i can imagine that in live systems once a day is sufficient.

@ernstleierzopf
Copy link
Contributor

I don't think it is smart or possible to reload the complete configs from an file as this happens in the aminer.py class. The program would not be stable if too many changes were made. The way to go is to restart the aminer with the old config file. Single config settings already can be changed. Restoring them is also possible by just reversing the values of the initial remote control command.

I am not sure if I understand the comment correctly, since this issue is not about the config, but only the persisted data.

I understood the first comment as restoring the whole config. If that was not the case, everything is clear.

@ernstleierzopf
Copy link
Contributor

Is it ok to create a seperate folder for the backups ([persistence_dir]_backup/yyyy-mm-dd-hh-mm-ss, for exampe /var/lib/aminer_backup/yyyy-mm-dd-hh-mm-ss?
Copying a whole folder into a subfolder is problematic with most of the existing python functions.
By creating an seperate folder it is possible to use shutil.copytree().

I think this is what I suggested in the issue description. A separate folder that contains the persistencies, e.g., /var/lib/aminer/backup/yyyy-mm-dd-hh-mm-ss/NewMatchPathValueDetector/Default

as /var/lib/aminer is the default persistence directory /var/lib/aminer/backup is an subfolder of that. Better is /var/lib/aminer_backup for example.

@landauermax
Copy link
Contributor Author

No, this issue is not about restoring the config, only the persistency.

Please create a subfolder backup in the /var/lib/aminer/ directory. The reason for this is that creating a new directory /var/lib/aminer_backup may cause issues with permissions. /var/lib/aminer is the directory of the user aminer, which we assume for our process.

@ernstleierzopf
Copy link
Contributor

Okay. I have changed that. shutil offers ignore_patterns which are helpful in this case.

@whotwagner whotwagner moved this from To do to In progress in Aminer Oct 27, 2020
@whotwagner whotwagner linked a pull request Oct 27, 2020 that will close this issue
@ernstleierzopf
Copy link
Contributor

Please move this issue to Done.

@whotwagner whotwagner moved this from In progress to Waiting for actions in Aminer Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Aminer
  
Waiting for actions
Development

Successfully merging a pull request may close this issue.

3 participants