Normally you'd do this with a:
workspace myworkspace
db_export -f xml -a /path/to/file.xml
db_export -f pwdump -a /path/to/file.pwdump
This can be tedious if you want to spin down an instance with tons of workspaces on it. So I wrote a quick resource script to get it done. This takes a list of workspaces. I'm sure you can programmatically retrieve the workspaces but I didn't. Code below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ruby> | |
File.open("/root/workspaces.txt", "r") do |f| | |
f.each_line do |line| | |
run_single("workspace #{line}") | |
run_single("db_export -f xml -a /root/msf_workspace_export/#{line}_export_13Aug2016.xml") | |
run_single("db_export -f pwdump -a /root/msf_workspace_export/#{line}_export_13Aug2016.pwdump") | |
end | |
end | |
</ruby> |
1 comment:
Hey! Five years later... THANKS! ...Was useful for me today ;)
Post a Comment