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

add cli initiated config backup #1382

Closed
phillxnet opened this Issue Jul 8, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@phillxnet
Member

phillxnet commented Jul 8, 2016

In cases where Rockstor's Web-UI has failed catastrophically a cli initiated config-backup could play a valuable part in disaster recovery scenarios as it would then be possible to archive the current config and retrieve the resulting file via scp and then execute a pool / share import and config restore procedure.

The file could be stored identically to the current Web-UI backups and in the same format, ie zipped json in /opt/rockstor/static/config-backups. Obviously some cli feedback indicating the success or otherwise of the command should also be incorporated. And given the use of the same location and format, if the cli command fails at least the user would be led to finding previous config backups if they exist.

A related function here could be an automated config-backup just prior to every Rockstor update procedure.

@daniel-illi

This comment has been minimized.

Show comment
Hide comment
@daniel-illi

daniel-illi Dec 8, 2016

Contributor

I'm interested to work on this feature. As I don't have much experience with python (coming from ruby/java world), I need some pointers where to start.

I see that the config backup functionality is implemented in ConfigBackupListView#post.
I suppose the backup code should get extracted in its own stand-alone service class which can be used from the view and from the cli script.
Where should such service classes be placed in the project tree?

Contributor

daniel-illi commented Dec 8, 2016

I'm interested to work on this feature. As I don't have much experience with python (coming from ruby/java world), I need some pointers where to start.

I see that the config backup functionality is implemented in ConfigBackupListView#post.
I suppose the backup code should get extracted in its own stand-alone service class which can be used from the view and from the cli script.
Where should such service classes be placed in the project tree?

@schakrava

This comment has been minimized.

Show comment
Hide comment
@schakrava

schakrava Dec 9, 2016

Member

@daniel-illi great to hear you like to contribute! python should be super easy coming from java. You should read up on console scripts in python. and take a look at setup.py. You can also look at src/rockstor/scripts directory for various scripts that become binaries via console scripts mechanism.

You are right about extracting the view logic out into it's own callable. I haven't looked at the code recently, but sounds about right. I wouldn't call it "service" though. It can just be a function that's imported in your script as well as the view. This code can go under system/

Feel free to be bold with your changes.

Member

schakrava commented Dec 9, 2016

@daniel-illi great to hear you like to contribute! python should be super easy coming from java. You should read up on console scripts in python. and take a look at setup.py. You can also look at src/rockstor/scripts directory for various scripts that become binaries via console scripts mechanism.

You are right about extracting the view logic out into it's own callable. I haven't looked at the code recently, but sounds about right. I wouldn't call it "service" though. It can just be a function that's imported in your script as well as the view. This code can go under system/

Feel free to be bold with your changes.

@daniel-illi

This comment has been minimized.

Show comment
Hide comment
@daniel-illi

daniel-illi Dec 10, 2016

Contributor

@schakrava thanks for the pointers.
I'll implement a first version and will open a pull request for you to comment.

Contributor

daniel-illi commented Dec 10, 2016

@schakrava thanks for the pointers.
I'll implement a first version and will open a pull request for you to comment.

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Dec 10, 2016

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Dec 11, 2016

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Jan 27, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Jan 27, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Jan 27, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Jan 27, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Mar 27, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue Mar 27, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue May 15, 2017

daniel-illi added a commit to daniel-illi/rockstor-core that referenced this issue May 15, 2017

@schakrava schakrava added this to the Panamint Valley milestone Jun 25, 2017

@schakrava

This comment has been minimized.

Show comment
Hide comment
@schakrava

schakrava Jun 25, 2017

Member

Fixed by #1576

Member

schakrava commented Jun 25, 2017

Fixed by #1576

@schakrava schakrava closed this Jun 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment