mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 09:16:11 +01:00
incremental backup: exclude repo folder
This commit is contained in:
408
.idea/workspace.xml
generated
408
.idea/workspace.xml
generated
@@ -28,56 +28,96 @@
|
|||||||
<component name="FileEditorManager">
|
<component name="FileEditorManager">
|
||||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/static/mailServer/mailServer.js">
|
<entry file="file://$PROJECT_DIR$/IncBackups/templates/IncBackups/restoreRemoteBackups.html">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="22">
|
<state relative-caret-position="183">
|
||||||
<caret line="1035" column="23" selection-start-line="1035" selection-start-column="11" selection-end-line="1035" selection-end-column="23" />
|
<caret line="100" column="69" selection-start-line="100" selection-start-column="69" selection-end-line="100" selection-end-column="69" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/static/IncBackups/IncBackups.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="329">
|
||||||
|
<caret line="862" column="44" selection-start-line="862" selection-start-column="44" selection-end-line="862" selection-end-column="44" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="e#20255#22112#0" />
|
<element signature="e#104#7601#0" />
|
||||||
<element signature="e#22521#24394#0" />
|
<element signature="e#491#2247#0" />
|
||||||
<element signature="e#24458#26343#0" />
|
<element signature="e#2295#2339#0" />
|
||||||
|
<element signature="e#2390#3395#0" />
|
||||||
|
<element signature="e#7703#12595#0" />
|
||||||
|
<element signature="e#12661#19357#0" />
|
||||||
|
<element signature="e#19645#19793#0" />
|
||||||
|
<element signature="e#19833#19981#0" />
|
||||||
|
<element signature="e#19827#21583#0" />
|
||||||
|
<element signature="e#24908#26073#0" />
|
||||||
|
<element signature="e#26129#26932#0" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/templates/mailServer/emailForwarding.html">
|
<entry file="file://$PROJECT_DIR$/IncBackups/views.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="285">
|
<state relative-caret-position="425">
|
||||||
<caret line="100" column="117" lean-forward="true" selection-start-line="100" selection-start-column="117" selection-end-line="100" selection-end-column="117" />
|
<caret line="297" column="54" selection-start-line="297" selection-start-column="46" selection-end-line="297" selection-end-column="54" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#24#63#0" expanded="true" />
|
||||||
|
<element signature="e#828#1780#0" />
|
||||||
|
<element signature="e#1819#2241#0" />
|
||||||
|
<element signature="e#2276#5793#0" />
|
||||||
|
<element signature="e#5836#8066#0" />
|
||||||
|
<element signature="e#8104#8957#0" />
|
||||||
|
<element signature="e#10654#12483#0" />
|
||||||
|
<element signature="e#12519#14515#0" />
|
||||||
|
<element signature="e#14548#15355#0" />
|
||||||
|
<element signature="e#15394#16774#0" />
|
||||||
|
<element signature="e#16807#17984#0" />
|
||||||
|
<element signature="e#18020#18977#0" />
|
||||||
|
<element signature="e#19018#20554#0" />
|
||||||
|
<element signature="e#20600#21659#0" />
|
||||||
|
<element signature="e#21694#22343#0" />
|
||||||
|
<element signature="e#22380#23332#0" />
|
||||||
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="true">
|
<file pinned="false" current-in-tab="true">
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/mailserverManager.py">
|
<entry file="file://$PROJECT_DIR$/IncBackups/IncBackupsControl.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="292">
|
<state relative-caret-position="165">
|
||||||
<caret line="355" column="48" selection-start-line="355" selection-start-column="48" selection-end-line="355" selection-end-column="48" />
|
<caret line="166" column="141" selection-start-line="166" selection-start-column="141" selection-end-line="166" selection-end-column="141" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="e#5347#7486#0" />
|
<element signature="e#907#1022#0" />
|
||||||
<element signature="e#7404#8499#0" />
|
<element signature="e#1776#3347#0" />
|
||||||
<element signature="e#8540#9296#0" />
|
<element signature="e#1630#1790#0" />
|
||||||
<element signature="e#9472#12776#0" />
|
<element signature="e#1886#3617#0" />
|
||||||
<element signature="e#14319#15920#0" />
|
<element signature="e#6536#6983#0" />
|
||||||
<element signature="e#15985#16779#0" />
|
<element signature="e#7024#7855#0" />
|
||||||
<element signature="e#16825#18660#0" />
|
<element signature="e#7893#8339#0" />
|
||||||
<element signature="e#18710#19389#0" />
|
<element signature="e#8384#9269#0" />
|
||||||
<element signature="e#19428#21357#0" />
|
<element signature="e#9307#10983#0" />
|
||||||
<element signature="e#21399#24129#0" />
|
<element signature="e#11052#16886#0" />
|
||||||
<element signature="e#24170#24855#0" />
|
<element signature="e#17713#18882#0" />
|
||||||
<element signature="e#24902#26851#0" />
|
<element signature="e#18919#19685#0" />
|
||||||
|
<element signature="e#19721#20482#0" />
|
||||||
|
<element signature="e#20520#22064#0" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/models.py">
|
<entry file="file://$PROJECT_DIR$/IncBackups/urls.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="367">
|
<state relative-caret-position="75">
|
||||||
<caret line="47" column="33" selection-start-line="47" selection-start-column="33" selection-end-line="47" selection-end-column="33" />
|
<caret line="5" column="92" selection-start-line="5" selection-start-column="69" selection-end-line="5" selection-end-column="92" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#0#32#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -94,11 +134,6 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="FindInProjectRecents">
|
<component name="FindInProjectRecents">
|
||||||
<findStrings>
|
<findStrings>
|
||||||
<find>setupVirtualEnv</find>
|
|
||||||
<find>python</find>
|
|
||||||
<find>setupDKIM</find>
|
|
||||||
<find>submitWebsiteCreation</find>
|
|
||||||
<find>submitWebsitecrea</find>
|
|
||||||
<find>createDomain</find>
|
<find>createDomain</find>
|
||||||
<find>submitDomain</find>
|
<find>submitDomain</find>
|
||||||
<find>getpass</find>
|
<find>getpass</find>
|
||||||
@@ -121,9 +156,14 @@
|
|||||||
<find>emailForwarding</find>
|
<find>emailForwarding</find>
|
||||||
<find>emailFor</find>
|
<find>emailFor</find>
|
||||||
<find>selectForwardingEmail</find>
|
<find>selectForwardingEmail</find>
|
||||||
<find>getEmailsForDomain</find>
|
|
||||||
<find>submitForwardDeletion</find>
|
<find>submitForwardDeletion</find>
|
||||||
|
<find>getEmailsForDomain</find>
|
||||||
<find>forwardEmail</find>
|
<find>forwardEmail</find>
|
||||||
|
<find>export</find>
|
||||||
|
<find>restoreRemoteBackupsInc</find>
|
||||||
|
<find>backupData</find>
|
||||||
|
<find>backupData(</find>
|
||||||
|
<find>sftpFunction</find>
|
||||||
</findStrings>
|
</findStrings>
|
||||||
<replaceStrings>
|
<replaceStrings>
|
||||||
<replace>admin.api == 1</replace>
|
<replace>admin.api == 1</replace>
|
||||||
@@ -154,7 +194,6 @@
|
|||||||
<component name="IdeDocumentHistory">
|
<component name="IdeDocumentHistory">
|
||||||
<option name="CHANGED_PATHS">
|
<option name="CHANGED_PATHS">
|
||||||
<list>
|
<list>
|
||||||
<option value="$PROJECT_DIR$/managePHP/ubuntuphp73.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/plogical/applicationInstaller.py" />
|
<option value="$PROJECT_DIR$/plogical/applicationInstaller.py" />
|
||||||
<option value="$PROJECT_DIR$/plogical/cPanelImporter.py" />
|
<option value="$PROJECT_DIR$/plogical/cPanelImporter.py" />
|
||||||
<option value="$PROJECT_DIR$/emailPremium/templates/emailPremium/emailLimits.html" />
|
<option value="$PROJECT_DIR$/emailPremium/templates/emailPremium/emailLimits.html" />
|
||||||
@@ -175,9 +214,7 @@
|
|||||||
<option value="$PROJECT_DIR$/postfixSenderPolicy/accept_traffic.py" />
|
<option value="$PROJECT_DIR$/postfixSenderPolicy/accept_traffic.py" />
|
||||||
<option value="$PROJECT_DIR$/s3Backups/s3Backups.py" />
|
<option value="$PROJECT_DIR$/s3Backups/s3Backups.py" />
|
||||||
<option value="$PROJECT_DIR$/IncBackups/models.py" />
|
<option value="$PROJECT_DIR$/IncBackups/models.py" />
|
||||||
<option value="$PROJECT_DIR$/IncBackups/urls.py" />
|
|
||||||
<option value="$PROJECT_DIR$/IncBackups/IncScheduler.py" />
|
<option value="$PROJECT_DIR$/IncBackups/IncScheduler.py" />
|
||||||
<option value="$PROJECT_DIR$/IncBackups/static/IncBackups/IncBackups.js" />
|
|
||||||
<option value="$PROJECT_DIR$/CyberCP/secMiddleware.py" />
|
<option value="$PROJECT_DIR$/CyberCP/secMiddleware.py" />
|
||||||
<option value="$PROJECT_DIR$/plogical/mysqlUtilities.py" />
|
<option value="$PROJECT_DIR$/plogical/mysqlUtilities.py" />
|
||||||
<option value="$PROJECT_DIR$/serverLogs/views.py" />
|
<option value="$PROJECT_DIR$/serverLogs/views.py" />
|
||||||
@@ -185,11 +222,8 @@
|
|||||||
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/incrementalDestinations.html" />
|
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/incrementalDestinations.html" />
|
||||||
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/createBackup.html" />
|
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/createBackup.html" />
|
||||||
<option value="$PROJECT_DIR$/plogical/adminPass.py" />
|
<option value="$PROJECT_DIR$/plogical/adminPass.py" />
|
||||||
<option value="$PROJECT_DIR$/baseTemplate/templates/baseTemplate/index.html" />
|
|
||||||
<option value="$PROJECT_DIR$/IncBackups/IncBackupsControl.py" />
|
|
||||||
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/backupSchedule.html" />
|
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/backupSchedule.html" />
|
||||||
<option value="$PROJECT_DIR$/install/firewallUtilities.py" />
|
<option value="$PROJECT_DIR$/install/firewallUtilities.py" />
|
||||||
<option value="$PROJECT_DIR$/IncBackups/views.py" />
|
|
||||||
<option value="$PROJECT_DIR$/preUpgrade.sh" />
|
<option value="$PROJECT_DIR$/preUpgrade.sh" />
|
||||||
<option value="$PROJECT_DIR$/plogical/upgrade.py" />
|
<option value="$PROJECT_DIR$/plogical/upgrade.py" />
|
||||||
<option value="$PROJECT_DIR$/plogical/processUtilities.py" />
|
<option value="$PROJECT_DIR$/plogical/processUtilities.py" />
|
||||||
@@ -205,6 +239,12 @@
|
|||||||
<option value="$PROJECT_DIR$/mailServer/static/mailServer/mailServer.js" />
|
<option value="$PROJECT_DIR$/mailServer/static/mailServer/mailServer.js" />
|
||||||
<option value="$PROJECT_DIR$/mailServer/templates/mailServer/emailForwarding.html" />
|
<option value="$PROJECT_DIR$/mailServer/templates/mailServer/emailForwarding.html" />
|
||||||
<option value="$PROJECT_DIR$/mailServer/mailserverManager.py" />
|
<option value="$PROJECT_DIR$/mailServer/mailserverManager.py" />
|
||||||
|
<option value="$PROJECT_DIR$/IncBackups/urls.py" />
|
||||||
|
<option value="$PROJECT_DIR$/baseTemplate/templates/baseTemplate/index.html" />
|
||||||
|
<option value="$PROJECT_DIR$/IncBackups/views.py" />
|
||||||
|
<option value="$PROJECT_DIR$/IncBackups/static/IncBackups/IncBackups.js" />
|
||||||
|
<option value="$PROJECT_DIR$/IncBackups/templates/IncBackups/restoreRemoteBackups.html" />
|
||||||
|
<option value="$PROJECT_DIR$/IncBackups/IncBackupsControl.py" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@@ -229,7 +269,33 @@
|
|||||||
<path>
|
<path>
|
||||||
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
|
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
|
||||||
<item name="CyberCP" type="462c0819:PsiDirectoryNode" />
|
<item name="CyberCP" type="462c0819:PsiDirectoryNode" />
|
||||||
<item name="mailServer" type="462c0819:PsiDirectoryNode" />
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="CyberCP" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="static" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="CyberCP" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="static" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="CyberCP" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="templates" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="CyberCP" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="templates" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="IncBackups" type="462c0819:PsiDirectoryNode" />
|
||||||
</path>
|
</path>
|
||||||
</expand>
|
</expand>
|
||||||
<select />
|
<select />
|
||||||
@@ -239,22 +305,22 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">
|
<component name="PropertiesComponent">
|
||||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/IncBackups" />
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/IncBackups/templates/IncBackups" />
|
||||||
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
||||||
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
||||||
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
||||||
</component>
|
</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
|
||||||
<recent name="$PROJECT_DIR$/websiteFunctions" />
|
|
||||||
</key>
|
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="$PROJECT_DIR$/IncBackups" />
|
|
||||||
<recent name="$PROJECT_DIR$/IncBackups/templates/IncBackups" />
|
<recent name="$PROJECT_DIR$/IncBackups/templates/IncBackups" />
|
||||||
|
<recent name="$PROJECT_DIR$/IncBackups" />
|
||||||
<recent name="$PROJECT_DIR$/dns/templates/dns" />
|
<recent name="$PROJECT_DIR$/dns/templates/dns" />
|
||||||
<recent name="$PROJECT_DIR$/mailServer/templates/mailServer" />
|
<recent name="$PROJECT_DIR$/mailServer/templates/mailServer" />
|
||||||
<recent name="$PROJECT_DIR$/packages/templates/packages" />
|
<recent name="$PROJECT_DIR$/packages/templates/packages" />
|
||||||
</key>
|
</key>
|
||||||
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
|
<recent name="$PROJECT_DIR$/websiteFunctions" />
|
||||||
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunDashboard">
|
<component name="RunDashboard">
|
||||||
<option name="ruleStates">
|
<option name="ruleStates">
|
||||||
@@ -443,18 +509,18 @@
|
|||||||
<workItem from="1571158869749" duration="705000" />
|
<workItem from="1571158869749" duration="705000" />
|
||||||
<workItem from="1571160353900" duration="938000" />
|
<workItem from="1571160353900" duration="938000" />
|
||||||
<workItem from="1571162569598" duration="21905000" />
|
<workItem from="1571162569598" duration="21905000" />
|
||||||
<workItem from="1572178630393" duration="2931000" />
|
<workItem from="1572178630393" duration="10211000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="733682000" />
|
<option name="totallyTimeSpent" value="740962000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<frame x="0" y="25" width="1366" height="684" extended-state="6" />
|
<frame x="0" y="25" width="1366" height="684" extended-state="6" />
|
||||||
<editor active="true" />
|
<editor active="true" />
|
||||||
<layout>
|
<layout>
|
||||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.022727273" />
|
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.05530303" />
|
||||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||||
<window_info id="Favorites" order="2" side_tool="true" />
|
<window_info id="Favorites" order="2" side_tool="true" />
|
||||||
<window_info anchor="bottom" id="Message" order="0" />
|
<window_info anchor="bottom" id="Message" order="0" />
|
||||||
@@ -538,27 +604,6 @@
|
|||||||
<SUITE FILE_PATH="coverage/CyberCP$upgrade.coverage" NAME="upgrade Coverage Results" MODIFIED="1571472730271" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/plogical" />
|
<SUITE FILE_PATH="coverage/CyberCP$upgrade.coverage" NAME="upgrade Coverage Results" MODIFIED="1571472730271" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/plogical" />
|
||||||
</component>
|
</component>
|
||||||
<component name="editorHistoryManager">
|
<component name="editorHistoryManager">
|
||||||
<entry file="file://$PROJECT_DIR$/s3Backups/s3Backups.py">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="472">
|
|
||||||
<caret line="1391" selection-start-line="1391" selection-end-line="1391" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/CLManager/static/CLManager/CLManager.js">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="30">
|
|
||||||
<caret line="100" selection-start-line="100" selection-end-line="255" selection-end-column="3" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#76#2714#0" />
|
|
||||||
<element signature="e#2778#6950#0" />
|
|
||||||
<element signature="e#7013#8796#0" />
|
|
||||||
<element signature="e#8866#13377#0" />
|
|
||||||
<element signature="e#13468#26129#0" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/backup/templates/backup/remoteBackups.html">
|
<entry file="file://$PROJECT_DIR$/backup/templates/backup/remoteBackups.html">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="353">
|
<state relative-caret-position="353">
|
||||||
@@ -591,16 +636,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/IncBackups/urls.py">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="75">
|
|
||||||
<caret line="5" column="89" lean-forward="true" selection-start-line="5" selection-start-column="89" selection-end-line="5" selection-end-column="89" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#0#32#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/backup/backupManager.py">
|
<entry file="file://$PROJECT_DIR$/backup/backupManager.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="227">
|
<state relative-caret-position="227">
|
||||||
@@ -741,13 +776,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/IncBackups/templates/IncBackups/createBackup.html">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="255">
|
|
||||||
<caret line="17" column="14" lean-forward="true" selection-start-line="17" selection-start-column="14" selection-end-line="17" selection-end-column="14" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/plogical/adminPass.py">
|
<entry file="file://$PROJECT_DIR$/plogical/adminPass.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="184">
|
<state relative-caret-position="184">
|
||||||
@@ -755,26 +783,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/IncBackups/static/IncBackups/IncBackups.js">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="302">
|
|
||||||
<caret line="159" column="48" selection-start-line="159" selection-start-column="48" selection-end-line="159" selection-end-column="48" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#491#2247#0" />
|
|
||||||
<element signature="e#2295#2339#0" />
|
|
||||||
<element signature="e#2390#3395#0" />
|
|
||||||
<element signature="e#4656#5485#0" />
|
|
||||||
<element signature="e#5523#6688#0" />
|
|
||||||
<element signature="e#6744#7547#0" />
|
|
||||||
<element signature="e#7654#12511#0" />
|
|
||||||
<element signature="e#8121#9397#0" />
|
|
||||||
<element signature="e#9444#11129#0" />
|
|
||||||
<element signature="e#11190#12506#0" />
|
|
||||||
<element signature="e#12577#19273#0" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/baseTemplate/templates/baseTemplate/indexJavaFixed.html">
|
<entry file="file://$PROJECT_DIR$/baseTemplate/templates/baseTemplate/indexJavaFixed.html">
|
||||||
<provider selected="true" editor-type-id="text-editor" />
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
</entry>
|
</entry>
|
||||||
@@ -785,13 +793,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/baseTemplate/templates/baseTemplate/index.html">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="8850">
|
|
||||||
<caret line="590" column="104" selection-start-line="590" selection-start-column="104" selection-end-line="590" selection-end-column="104" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/IncBackups/IncScheduler.py">
|
<entry file="file://$PROJECT_DIR$/IncBackups/IncScheduler.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="285">
|
<state relative-caret-position="285">
|
||||||
@@ -809,42 +810,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/IncBackups/views.py">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="337">
|
|
||||||
<caret line="126" column="23" lean-forward="true" selection-start-line="126" selection-start-column="23" selection-end-line="126" selection-end-column="23" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#24#63#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/IncBackups/IncBackupsControl.py">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="68">
|
|
||||||
<caret line="152" column="30" selection-start-line="152" selection-start-column="30" selection-end-line="152" selection-end-column="30" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#907#1022#0" />
|
|
||||||
<element signature="e#1124#1419#0" />
|
|
||||||
<element signature="e#1449#1594#0" />
|
|
||||||
<element signature="e#1886#3617#0" />
|
|
||||||
<element signature="e#3690#4946#0" />
|
|
||||||
<element signature="e#5018#6499#0" />
|
|
||||||
<element signature="e#6536#6983#0" />
|
|
||||||
<element signature="e#7024#7855#0" />
|
|
||||||
<element signature="e#7893#8339#0" />
|
|
||||||
<element signature="e#8384#9269#0" />
|
|
||||||
<element signature="e#9307#10983#0" />
|
|
||||||
<element signature="e#11052#16886#0" />
|
|
||||||
<element signature="e#16922#17672#0" />
|
|
||||||
<element signature="e#17713#18882#0" />
|
|
||||||
<element signature="e#18919#19685#0" />
|
|
||||||
<element signature="e#19721#20482#0" />
|
|
||||||
<element signature="e#20520#22064#0" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/plogical/upgrade.py">
|
<entry file="file://$PROJECT_DIR$/plogical/upgrade.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="247">
|
<state relative-caret-position="247">
|
||||||
@@ -1197,25 +1162,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/static/mailServer/mailServer.js">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="22">
|
|
||||||
<caret line="1035" column="23" selection-start-line="1035" selection-start-column="11" selection-end-line="1035" selection-end-column="23" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#20255#22112#0" />
|
|
||||||
<element signature="e#22521#24394#0" />
|
|
||||||
<element signature="e#24458#26343#0" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/templates/mailServer/emailForwarding.html">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="285">
|
|
||||||
<caret line="100" column="117" lean-forward="true" selection-start-line="100" selection-start-column="117" selection-end-line="100" selection-end-column="117" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/mailServer/mailserverManager.py">
|
<entry file="file://$PROJECT_DIR$/mailServer/mailserverManager.py">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="292">
|
<state relative-caret-position="292">
|
||||||
@@ -1237,5 +1183,131 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/mailServer/templates/mailServer/emailForwarding.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="285">
|
||||||
|
<caret line="100" column="117" lean-forward="true" selection-start-line="100" selection-start-column="117" selection-end-line="100" selection-end-column="117" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/urls.py">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="75">
|
||||||
|
<caret line="5" column="92" selection-start-line="5" selection-start-column="69" selection-end-line="5" selection-end-column="92" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#0#32#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/baseTemplate/templates/baseTemplate/index.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="377">
|
||||||
|
<caret line="606" column="98" selection-start-line="606" selection-start-column="98" selection-end-line="606" selection-end-column="98" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/websiteFunctions/templates/websiteFunctions/createWebsite.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="255">
|
||||||
|
<caret line="59" column="24" selection-start-line="59" selection-start-column="24" selection-end-line="66" selection-end-column="30" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/mailServer/static/mailServer/mailServer.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="340">
|
||||||
|
<caret line="1035" column="23" selection-start-line="1035" selection-start-column="11" selection-end-line="1035" selection-end-column="23" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#20255#22112#0" />
|
||||||
|
<element signature="e#22521#24394#0" />
|
||||||
|
<element signature="e#24458#26343#0" />
|
||||||
|
<element signature="e#26384#28295#0" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/templates/IncBackups/createBackup.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="405">
|
||||||
|
<caret line="114" column="30" lean-forward="true" selection-start-line="108" selection-start-column="24" selection-end-line="114" selection-end-column="30" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/static/IncBackups/IncBackups.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="329">
|
||||||
|
<caret line="862" column="44" selection-start-line="862" selection-start-column="44" selection-end-line="862" selection-end-column="44" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#104#7601#0" />
|
||||||
|
<element signature="e#491#2247#0" />
|
||||||
|
<element signature="e#2295#2339#0" />
|
||||||
|
<element signature="e#2390#3395#0" />
|
||||||
|
<element signature="e#7703#12595#0" />
|
||||||
|
<element signature="e#12661#19357#0" />
|
||||||
|
<element signature="e#19645#19793#0" />
|
||||||
|
<element signature="e#19833#19981#0" />
|
||||||
|
<element signature="e#19827#21583#0" />
|
||||||
|
<element signature="e#24908#26073#0" />
|
||||||
|
<element signature="e#26129#26932#0" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/templates/IncBackups/restoreRemoteBackups.html">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="183">
|
||||||
|
<caret line="100" column="69" selection-start-line="100" selection-start-column="69" selection-end-line="100" selection-end-column="69" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/views.py">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="425">
|
||||||
|
<caret line="297" column="54" selection-start-line="297" selection-start-column="46" selection-end-line="297" selection-end-column="54" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#24#63#0" expanded="true" />
|
||||||
|
<element signature="e#828#1780#0" />
|
||||||
|
<element signature="e#1819#2241#0" />
|
||||||
|
<element signature="e#2276#5793#0" />
|
||||||
|
<element signature="e#5836#8066#0" />
|
||||||
|
<element signature="e#8104#8957#0" />
|
||||||
|
<element signature="e#10654#12483#0" />
|
||||||
|
<element signature="e#12519#14515#0" />
|
||||||
|
<element signature="e#14548#15355#0" />
|
||||||
|
<element signature="e#15394#16774#0" />
|
||||||
|
<element signature="e#16807#17984#0" />
|
||||||
|
<element signature="e#18020#18977#0" />
|
||||||
|
<element signature="e#19018#20554#0" />
|
||||||
|
<element signature="e#20600#21659#0" />
|
||||||
|
<element signature="e#21694#22343#0" />
|
||||||
|
<element signature="e#22380#23332#0" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/IncBackups/IncBackupsControl.py">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="165">
|
||||||
|
<caret line="166" column="141" selection-start-line="166" selection-start-column="141" selection-end-line="166" selection-end-column="141" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#907#1022#0" />
|
||||||
|
<element signature="e#1776#3347#0" />
|
||||||
|
<element signature="e#1630#1790#0" />
|
||||||
|
<element signature="e#1886#3617#0" />
|
||||||
|
<element signature="e#6536#6983#0" />
|
||||||
|
<element signature="e#7024#7855#0" />
|
||||||
|
<element signature="e#7893#8339#0" />
|
||||||
|
<element signature="e#8384#9269#0" />
|
||||||
|
<element signature="e#9307#10983#0" />
|
||||||
|
<element signature="e#11052#16886#0" />
|
||||||
|
<element signature="e#17713#18882#0" />
|
||||||
|
<element signature="e#18919#19685#0" />
|
||||||
|
<element signature="e#19721#20482#0" />
|
||||||
|
<element signature="e#20520#22064#0" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -2,10 +2,12 @@
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.append('/usr/local/CyberCP')
|
sys.path.append('/usr/local/CyberCP')
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
|
||||||
|
|
||||||
import django
|
import django
|
||||||
|
|
||||||
try:
|
try:
|
||||||
django.setup()
|
django.setup()
|
||||||
except:
|
except:
|
||||||
@@ -25,12 +27,16 @@ from plogical.backupUtilities import backupUtilities
|
|||||||
from plogical.dnsUtilities import DNS
|
from plogical.dnsUtilities import DNS
|
||||||
from mailServer.models import Domains as eDomains
|
from mailServer.models import Domains as eDomains
|
||||||
from random import randint
|
from random import randint
|
||||||
|
import json
|
||||||
|
from django.shortcuts import HttpResponse
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from plogical.virtualHostUtilities import virtualHostUtilities
|
from plogical.virtualHostUtilities import virtualHostUtilities
|
||||||
from plogical.mailUtilities import mailUtilities
|
from plogical.mailUtilities import mailUtilities
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class IncJobs(multi.Thread):
|
class IncJobs(multi.Thread):
|
||||||
|
|
||||||
def __init__(self, function, extraArgs):
|
def __init__(self, function, extraArgs):
|
||||||
@@ -51,6 +57,72 @@ class IncJobs(multi.Thread):
|
|||||||
self.createBackup()
|
self.createBackup()
|
||||||
elif self.function == 'restorePoint':
|
elif self.function == 'restorePoint':
|
||||||
self.restorePoint()
|
self.restorePoint()
|
||||||
|
elif self.function == 'remoteRestore':
|
||||||
|
self.restorePoint()
|
||||||
|
|
||||||
|
def getRemoteBackups(self):
|
||||||
|
if self.jobid.destination == 'local':
|
||||||
|
path = '/home/%s/incbackup' % (self.website)
|
||||||
|
command = 'export RESTIC_PASSWORD=%s && restic -r %s snapshots' % (self.passwordFile, path)
|
||||||
|
return ProcessUtilities.outputExecutioner(command).split('\n')
|
||||||
|
elif self.jobid.destination[:4] == 'sftp':
|
||||||
|
path = '/home/backup/%s' % (self.website)
|
||||||
|
command = 'export RESTIC_PASSWORD=%s PATH=${PATH}:/usr/bin && restic -r %s:%s snapshots' % (
|
||||||
|
self.passwordFile, self.backupDestinations, path)
|
||||||
|
return ProcessUtilities.outputExecutioner(command).split('\n')
|
||||||
|
else:
|
||||||
|
path = '/home/%s/incbackup' % (self.website)
|
||||||
|
command = 'export RESTIC_PASSWORD=%s && restic -r %s snapshots' % (self.passwordFile, path)
|
||||||
|
return ProcessUtilities.outputExecutioner(command).split('\n')
|
||||||
|
|
||||||
|
def fetchCurrentBackups(self):
|
||||||
|
try:
|
||||||
|
self.website = self.extraArgs['website']
|
||||||
|
self.backupDestinations = self.extraArgs['backupDestinations']
|
||||||
|
self.passwordFile = self.extraArgs['password']
|
||||||
|
|
||||||
|
remotePath = '/home/backup/%s' % (self.website)
|
||||||
|
|
||||||
|
command = 'export RESTIC_PASSWORD=%s PATH=${PATH}:/usr/bin && restic -r %s:%s snapshots' % (
|
||||||
|
self.passwordFile, self.backupDestinations, remotePath)
|
||||||
|
result = ProcessUtilities.outputExecutioner(command).split('\n')
|
||||||
|
|
||||||
|
activator = 0
|
||||||
|
json_data = "["
|
||||||
|
checker = 0
|
||||||
|
|
||||||
|
for items in result:
|
||||||
|
if items.find('---------------') > -1:
|
||||||
|
if activator == 0:
|
||||||
|
activator = 1
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
activator = 0
|
||||||
|
|
||||||
|
if activator:
|
||||||
|
entry = items.split(' ')
|
||||||
|
logging.writeToFile(str(entry))
|
||||||
|
|
||||||
|
dic = {'id': entry[0],
|
||||||
|
'date': "%s %s" % (entry[2], entry[3]),
|
||||||
|
'host': entry[5],
|
||||||
|
'path': entry[-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
if checker == 0:
|
||||||
|
json_data = json_data + json.dumps(dic)
|
||||||
|
checker = 1
|
||||||
|
else:
|
||||||
|
json_data = json_data + ',' + json.dumps(dic)
|
||||||
|
|
||||||
|
json_data = json_data + ']'
|
||||||
|
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
except BaseException, msg:
|
||||||
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
def getAWSData(self):
|
def getAWSData(self):
|
||||||
key = self.backupDestinations.split('/')[-1]
|
key = self.backupDestinations.split('/')[-1]
|
||||||
@@ -58,22 +130,24 @@ class IncJobs(multi.Thread):
|
|||||||
secret = open(path, 'r').read()
|
secret = open(path, 'r').read()
|
||||||
return key, secret
|
return key, secret
|
||||||
|
|
||||||
def awsFunction(self, fType, backupPath = None, snapshotID = None, bType = None):
|
def awsFunction(self, fType, backupPath=None, snapshotID=None, bType=None):
|
||||||
try:
|
try:
|
||||||
if fType == 'backup':
|
if fType == 'backup':
|
||||||
key, secret = self.getAWSData()
|
key, secret = self.getAWSData()
|
||||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s' % (
|
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s' % (
|
||||||
key, secret, self.website.domain, backupPath, self.passwordFile)
|
key, secret, self.website.domain, backupPath, self.passwordFile)
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
snapShotid = result.split(' ')[-2]
|
snapShotid = result.split(' ')[-2]
|
||||||
if bType == 'database':
|
if bType == 'database':
|
||||||
newSnapshot = JobSnapshots(job=self.jobid, type='%s:%s' % (bType, backupPath.split('/')[-1].strip('.sql')),
|
newSnapshot = JobSnapshots(job=self.jobid,
|
||||||
|
type='%s:%s' % (bType, backupPath.split('/')[-1].strip('.sql')),
|
||||||
snapshotid=snapShotid,
|
snapshotid=snapShotid,
|
||||||
destination=self.backupDestinations)
|
destination=self.backupDestinations)
|
||||||
else:
|
else:
|
||||||
newSnapshot = JobSnapshots(job=self.jobid, type='%s:%s' % (bType, backupPath), snapshotid=snapShotid,
|
newSnapshot = JobSnapshots(job=self.jobid, type='%s:%s' % (bType, backupPath),
|
||||||
destination=self.backupDestinations)
|
snapshotid=snapShotid,
|
||||||
|
destination=self.backupDestinations)
|
||||||
newSnapshot.save()
|
newSnapshot.save()
|
||||||
else:
|
else:
|
||||||
self.backupDestinations = self.jobid.destination
|
self.backupDestinations = self.jobid.destination
|
||||||
@@ -88,9 +162,9 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath, "%s [88][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [88][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def localFunction(self, backupPath, type, restore = None):
|
def localFunction(self, backupPath, type, restore=None):
|
||||||
if restore == None:
|
if restore == None:
|
||||||
command = 'restic -r %s backup %s --password-file %s' % (self.repoPath, backupPath, self.passwordFile)
|
command = 'restic -r %s backup %s --password-file %s --exclude %s' % (self.repoPath, backupPath, self.passwordFile, self.repoPath)
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
snapShotid = result.split(' ')[-2]
|
snapShotid = result.split(' ')[-2]
|
||||||
@@ -107,11 +181,11 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
repoLocation = '/home/%s/incbackup' % (self.website)
|
repoLocation = '/home/%s/incbackup' % (self.website)
|
||||||
command = 'restic -r %s restore %s --target / --password-file %s' % (
|
command = 'restic -r %s restore %s --target / --password-file %s' % (
|
||||||
repoLocation, self.jobid.snapshotid, self.passwordFile)
|
repoLocation, self.jobid.snapshotid, self.passwordFile)
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
|
|
||||||
def sftpFunction(self, backupPath, type, restore = None):
|
def sftpFunction(self, backupPath, type, restore=None):
|
||||||
if restore == None:
|
if restore == None:
|
||||||
remotePath = '/home/backup/%s' % (self.website.domain)
|
remotePath = '/home/backup/%s' % (self.website.domain)
|
||||||
command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s backup %s --password-file %s --exclude %s' % (
|
command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s backup %s --password-file %s --exclude %s' % (
|
||||||
@@ -132,7 +206,7 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
repoLocation = '/home/backup/%s' % (self.website)
|
repoLocation = '/home/backup/%s' % (self.website)
|
||||||
command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s restore %s --target / --password-file %s' % (
|
command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s restore %s --target / --password-file %s' % (
|
||||||
self.jobid.destination, repoLocation, self.jobid.snapshotid, self.passwordFile)
|
self.jobid.destination, repoLocation, self.jobid.snapshotid, self.passwordFile)
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
|
|
||||||
@@ -160,7 +234,8 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
self.awsFunction('restore', '', self.jobid.snapshotid)
|
self.awsFunction('restore', '', self.jobid.snapshotid)
|
||||||
|
|
||||||
if mysqlUtilities.mysqlUtilities.restoreDatabaseBackup(self.jobid.type.split(':')[1].rstrip('.sql'), '/home/cyberpanel', 'dummy', 'dummy') == 0:
|
if mysqlUtilities.mysqlUtilities.restoreDatabaseBackup(self.jobid.type.split(':')[1].rstrip('.sql'),
|
||||||
|
'/home/cyberpanel', 'dummy', 'dummy') == 0:
|
||||||
raise BaseException
|
raise BaseException
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -189,7 +264,6 @@ class IncJobs(multi.Thread):
|
|||||||
def reconstructWithMeta(self):
|
def reconstructWithMeta(self):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
|
||||||
if self.jobid.destination == 'local':
|
if self.jobid.destination == 'local':
|
||||||
self.localFunction('none', 'none', 1)
|
self.localFunction('none', 'none', 1)
|
||||||
elif self.jobid.destination[:4] == 'sftp':
|
elif self.jobid.destination[:4] == 'sftp':
|
||||||
@@ -219,7 +293,6 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath, message, 1)
|
logging.statusWriter(self.statusPath, message, 1)
|
||||||
self.passwordFile = '/home/%s/%s' % (self.website, self.website)
|
self.passwordFile = '/home/%s/%s' % (self.website, self.website)
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
if self.jobid.type[:8] == 'database':
|
if self.jobid.type[:8] == 'database':
|
||||||
@@ -433,10 +506,11 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
self.awsFunction('backup', backupPath, '', 'data')
|
self.awsFunction('backup', backupPath, '', 'data')
|
||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Data for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
logging.statusWriter(self.statusPath,
|
||||||
|
'Data for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupData.223][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.backupData.223][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def backupDatabases(self):
|
def backupDatabases(self):
|
||||||
@@ -461,10 +535,11 @@ class IncJobs(multi.Thread):
|
|||||||
try:
|
try:
|
||||||
os.remove('/home/cyberpanel/%s.sql' % (items.dbName))
|
os.remove('/home/cyberpanel/%s.sql' % (items.dbName))
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'Failed to delete database: %s. [IncJobs.backupDatabases.456]' % str(msg), 1)
|
logging.statusWriter(self.statusPath,
|
||||||
|
'Failed to delete database: %s. [IncJobs.backupDatabases.456]' % str(msg), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def emailBackup(self):
|
def emailBackup(self):
|
||||||
@@ -480,11 +555,11 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
self.awsFunction('backup', backupPath, '', 'email')
|
self.awsFunction('backup', backupPath, '', 'email')
|
||||||
|
|
||||||
|
logging.statusWriter(self.statusPath,
|
||||||
logging.statusWriter(self.statusPath, 'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.emailBackup.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.emailBackup.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def metaBackup(self):
|
def metaBackup(self):
|
||||||
@@ -500,11 +575,11 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
self.awsFunction('backup', backupPath, '', 'meta')
|
self.awsFunction('backup', backupPath, '', 'meta')
|
||||||
|
|
||||||
|
logging.statusWriter(self.statusPath,
|
||||||
logging.statusWriter(self.statusPath, 'Meta for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
'Meta for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.metaBackup.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.metaBackup.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def initiateRepo(self):
|
def initiateRepo(self):
|
||||||
@@ -518,20 +593,23 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
elif self.backupDestinations[:4] == 'sftp':
|
elif self.backupDestinations[:4] == 'sftp':
|
||||||
remotePath = '/home/backup/%s' % (self.website.domain)
|
remotePath = '/home/backup/%s' % (self.website.domain)
|
||||||
command = 'export PATH=${PATH}:/usr/bin && restic init --repo %s:%s --password-file %s' % (self.backupDestinations, remotePath, self.passwordFile)
|
command = 'export PATH=${PATH}:/usr/bin && restic init --repo %s:%s --password-file %s' % (
|
||||||
|
self.backupDestinations, remotePath, self.passwordFile)
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
else:
|
else:
|
||||||
key,secret = self.getAWSData()
|
key, secret = self.getAWSData()
|
||||||
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s init --password-file %s' % (key, secret, self.website.domain, self.passwordFile)
|
command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s init --password-file %s' % (
|
||||||
|
key, secret, self.website.domain, self.passwordFile)
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Repo %s initiated for %s.' % (self.backupDestinations, self.website.domain), 1)
|
logging.statusWriter(self.statusPath,
|
||||||
|
'Repo %s initiated for %s.' % (self.backupDestinations, self.website.domain), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.initiateRepo.47][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.initiateRepo.47][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def createBackup(self):
|
def createBackup(self):
|
||||||
@@ -562,7 +640,6 @@ class IncJobs(multi.Thread):
|
|||||||
command = 'chmod 600 %s' % (self.passwordFile)
|
command = 'chmod 600 %s' % (self.passwordFile)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
|
||||||
if self.initiateRepo() == 0:
|
if self.initiateRepo() == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -589,6 +666,7 @@ class IncJobs(multi.Thread):
|
|||||||
command = 'rm -f %s' % (metaPathNew)
|
command = 'rm -f %s' % (metaPathNew)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.statusWriter(self.statusPath,'Failed to delete meta file: %s. [IncJobs.createBackup.591]' % str(msg), 1)
|
logging.statusWriter(self.statusPath,
|
||||||
|
'Failed to delete meta file: %s. [IncJobs.createBackup.591]' % str(msg), 1)
|
||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Completed', 1)
|
logging.statusWriter(self.statusPath, 'Completed', 1)
|
||||||
@@ -743,3 +743,220 @@ app.controller('scheduleBackupInc', function ($scope, $http) {
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.controller('restoreRemoteBackupsInc', function ($scope, $http, $timeout) {
|
||||||
|
|
||||||
|
$scope.destination = true;
|
||||||
|
$scope.backupButton = true;
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
$scope.runningBackup = true;
|
||||||
|
$scope.restoreSt = true;
|
||||||
|
|
||||||
|
$scope.showThings = function () {
|
||||||
|
$scope.destination = false;
|
||||||
|
$scope.runningBackup = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.fetchDetails = function () {
|
||||||
|
getBackupStatus();
|
||||||
|
$scope.populateCurrentRecords();
|
||||||
|
};
|
||||||
|
|
||||||
|
function getBackupStatus() {
|
||||||
|
|
||||||
|
$scope.cyberpanelLoadingBottom = false;
|
||||||
|
|
||||||
|
url = "/IncrementalBackups/getBackupStatus";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
websiteToBeBacked: $scope.websiteToBeBacked,
|
||||||
|
tempPath: $scope.tempPath
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
|
if (response.data.backupStatus === 1) {
|
||||||
|
|
||||||
|
if (response.data.abort === 1) {
|
||||||
|
$timeout.cancel();
|
||||||
|
$scope.cyberpanelLoadingBottom = true;
|
||||||
|
$scope.destination = false;
|
||||||
|
$scope.runningBackup = false;
|
||||||
|
$scope.backupButton = false;
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
$scope.fileName = response.data.fileName;
|
||||||
|
$scope.status = response.data.status;
|
||||||
|
$scope.populateCurrentRecords();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$scope.destination = true;
|
||||||
|
$scope.backupButton = true;
|
||||||
|
$scope.runningBackup = false;
|
||||||
|
|
||||||
|
$scope.fileName = response.data.fileName;
|
||||||
|
$scope.status = response.data.status;
|
||||||
|
$timeout(getBackupStatus, 2000);
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$timeout.cancel();
|
||||||
|
$scope.cyberpanelLoadingBottom = true;
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
$scope.backupButton = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.populateCurrentRecords = function () {
|
||||||
|
$scope.cyberpanelLoading = false;
|
||||||
|
|
||||||
|
url = "/IncrementalBackups/fetchCurrentBackups";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
websiteToBeBacked: $scope.websiteToBeBacked,
|
||||||
|
backupDestinations: $scope.backupDestinations,
|
||||||
|
password: $scope.password
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
$scope.records = JSON.parse(response.data.data);
|
||||||
|
} else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Error!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.restore = function (id) {
|
||||||
|
|
||||||
|
$scope.cyberpanelLoading = false;
|
||||||
|
|
||||||
|
|
||||||
|
url = "/IncrementalBackups/fetchRestorePoints";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
id: id,
|
||||||
|
websiteToBeBacked: $scope.websiteToBeBacked
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
$scope.jobs = JSON.parse(response.data.data);
|
||||||
|
} else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
$scope.cyberpanelLoading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.restorePoint = function (id, reconstruct) {
|
||||||
|
|
||||||
|
$scope.status = '';
|
||||||
|
|
||||||
|
$scope.cyberpanelLoading = false;
|
||||||
|
$scope.restoreSt = false;
|
||||||
|
|
||||||
|
|
||||||
|
url = "/IncrementalBackups/restorePoint";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
websiteToBeBacked: $scope.websiteToBeBacked,
|
||||||
|
jobid: id,
|
||||||
|
reconstruct: reconstruct
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
$scope.tempPath = response.data.tempPath;
|
||||||
|
getBackupStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialDatas(response) {
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
123
IncBackups/templates/IncBackups/restoreRemoteBackups.html
Executable file
123
IncBackups/templates/IncBackups/restoreRemoteBackups.html
Executable file
@@ -0,0 +1,123 @@
|
|||||||
|
{% extends "baseTemplate/index.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block title %}{% trans "Restore Remote Incremental Backups" %}{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div id="page-title">
|
||||||
|
<h2>{% trans "Restore Remote Incremental Backups" %} - <a target="_blank"
|
||||||
|
href="https://cyberpanel.net/docs/2-create-restore-incremental-backups/"
|
||||||
|
style="height: 23px;line-height: 21px;"
|
||||||
|
class="btn btn-border btn-alt border-red btn-link font-red"
|
||||||
|
title=""><span>{% trans "Backup Docs" %}</span></a>
|
||||||
|
</h2>
|
||||||
|
<p>{% trans "This page can be used to restore remote incremental backups for your websites." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-controller="restoreRemoteBackupsInc" class="panel">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h3 class="title-hero">
|
||||||
|
{% trans "Back up Website" %} <img ng-hide="cyberpanelLoading"
|
||||||
|
src="{% static 'images/loading.gif' %}">
|
||||||
|
</h3>
|
||||||
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
|
||||||
|
<form action="/" class="form-horizontal bordered-row">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select ng-change="showThings()" ng-model="websiteToBeBacked" class="form-control">
|
||||||
|
{% for items in websiteList %}
|
||||||
|
<option>{{ items }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="destination" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Destination" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select ng-model="backupDestinations"
|
||||||
|
class="form-control">
|
||||||
|
{% for items in destinations %}
|
||||||
|
<option>{{ items }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="destination" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="password" name="password" class="form-control" ng-model="password"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="destination" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label"></label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<button type="button" ng-click="fetchDetails()"
|
||||||
|
class="btn btn-primary btn-lg btn-block">{% trans "Fetch Restore Points" %} <img
|
||||||
|
ng-hide="cyberpanelLoading"
|
||||||
|
src="{% static 'images/loading.gif' %}"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------ List of records --------------->
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
<div class="col-sm-12">
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{% trans "Snapshot ID" %}</th>
|
||||||
|
<th>{% trans "Date" %}</th>
|
||||||
|
<th>{% trans "Host" %}</th>
|
||||||
|
<th>{% trans "Path" %}</th>
|
||||||
|
<th>{% trans "Actions" %}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="record in records track by $index">
|
||||||
|
<td ng-bind="record.id"></td>
|
||||||
|
<td ng-bind="record.date"></td>
|
||||||
|
<td ng-bind="record.host"></td>
|
||||||
|
<td ng-bind="record.path"></td>
|
||||||
|
<td>
|
||||||
|
<a ng-click="restore(record.id)" data-toggle="modal" data-target="#settings"
|
||||||
|
ng-click='deleteCLPackage()'
|
||||||
|
class="btn btn-border btn-alt border-green btn-link font-green"
|
||||||
|
title=""><span>Restore</span></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------ List of records --------------->
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -3,6 +3,7 @@ import views
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^createBackup$', views.createBackup, name='createBackupInc'),
|
url(r'^createBackup$', views.createBackup, name='createBackupInc'),
|
||||||
|
url(r'^restoreRemoteBackups$', views.restoreRemoteBackups, name='restoreRemoteBackupsInc'),
|
||||||
url(r'^backupDestinations$', views.backupDestinations, name='backupDestinationsInc'),
|
url(r'^backupDestinations$', views.backupDestinations, name='backupDestinationsInc'),
|
||||||
url(r'^addDestination$', views.addDestination, name='addDestinationInc'),
|
url(r'^addDestination$', views.addDestination, name='addDestinationInc'),
|
||||||
url(r'^populateCurrentRecords$', views.populateCurrentRecords, name='populateCurrentRecordsInc'),
|
url(r'^populateCurrentRecords$', views.populateCurrentRecords, name='populateCurrentRecordsInc'),
|
||||||
|
|||||||
@@ -288,36 +288,55 @@ def fetchCurrentBackups(request):
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadErrorJson()
|
return ACLManager.loadErrorJson()
|
||||||
|
|
||||||
website = Websites.objects.get(domain=backupDomain)
|
try:
|
||||||
|
backupDestinations = data['backupDestinations']
|
||||||
|
|
||||||
backups = website.incjob_set.all()
|
extraArgs = {}
|
||||||
|
extraArgs['website'] = backupDomain
|
||||||
|
extraArgs['backupDestinations'] = backupDestinations
|
||||||
|
try:
|
||||||
|
extraArgs['password'] = data['password']
|
||||||
|
except:
|
||||||
|
final_json = json.dumps({'status': 0, 'error_message': "Please supply the password."})
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
json_data = "["
|
startJob = IncJobs('Dummpy', extraArgs)
|
||||||
checker = 0
|
return startJob.fetchCurrentBackups()
|
||||||
|
|
||||||
for items in reversed(backups):
|
except:
|
||||||
|
|
||||||
includes = ""
|
website = Websites.objects.get(domain=backupDomain)
|
||||||
|
|
||||||
jobs = items.jobsnapshots_set.all()
|
backups = website.incjob_set.all()
|
||||||
|
|
||||||
for job in jobs:
|
json_data = "["
|
||||||
includes = '%s,%s:%s' % (includes, job.type, job.snapshotid)
|
checker = 0
|
||||||
|
|
||||||
dic = {'id': items.id,
|
for items in reversed(backups):
|
||||||
'date': str(items.date),
|
|
||||||
'includes': includes
|
includes = ""
|
||||||
}
|
|
||||||
|
jobs = items.jobsnapshots_set.all()
|
||||||
|
|
||||||
|
for job in jobs:
|
||||||
|
includes = '%s,%s:%s' % (includes, job.type, job.snapshotid)
|
||||||
|
|
||||||
|
dic = {'id': items.id,
|
||||||
|
'date': str(items.date),
|
||||||
|
'includes': includes
|
||||||
|
}
|
||||||
|
|
||||||
|
if checker == 0:
|
||||||
|
json_data = json_data + json.dumps(dic)
|
||||||
|
checker = 1
|
||||||
|
else:
|
||||||
|
json_data = json_data + ',' + json.dumps(dic)
|
||||||
|
|
||||||
|
json_data = json_data + ']'
|
||||||
|
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
if checker == 0:
|
|
||||||
json_data = json_data + json.dumps(dic)
|
|
||||||
checker = 1
|
|
||||||
else:
|
|
||||||
json_data = json_data + ',' + json.dumps(dic)
|
|
||||||
|
|
||||||
json_data = json_data + ']'
|
|
||||||
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
|
||||||
return HttpResponse(final_json)
|
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
@@ -687,3 +706,32 @@ def scheduleDelete(request):
|
|||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
def restoreRemoteBackups(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
|
if ACLManager.currentContextPermission(currentACL, 'createBackup') == 0:
|
||||||
|
return ACLManager.loadError()
|
||||||
|
|
||||||
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
|
|
||||||
|
destinations = []
|
||||||
|
destinations.append('local')
|
||||||
|
|
||||||
|
path = '/home/cyberpanel/sftp'
|
||||||
|
|
||||||
|
if os.path.exists(path):
|
||||||
|
for items in os.listdir(path):
|
||||||
|
destinations.append('sftp:%s' % (items))
|
||||||
|
|
||||||
|
path = '/home/cyberpanel/aws'
|
||||||
|
if os.path.exists(path):
|
||||||
|
for items in os.listdir(path):
|
||||||
|
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
||||||
|
|
||||||
|
return defRenderer(request, 'IncBackups/restoreRemoteBackups.html', {'websiteList': websitesName, 'destinations': destinations})
|
||||||
|
except BaseException, msg:
|
||||||
|
logging.writeToFile(str(msg))
|
||||||
|
return redirect(loadLoginPage)
|
||||||
@@ -604,6 +604,9 @@
|
|||||||
<li class="restoreBackup"><a href="{% url 'scheduleBackupsInc' %}"
|
<li class="restoreBackup"><a href="{% url 'scheduleBackupsInc' %}"
|
||||||
title="{% trans 'Schedule Back ups' %}"><span>{% trans "Schedule Back ups" %}</span></a>
|
title="{% trans 'Schedule Back ups' %}"><span>{% trans "Schedule Back ups" %}</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="remoteBackups"><a href="{% url 'restoreRemoteBackupsInc' %}"
|
||||||
|
title="{% trans 'Restore from Remote Server' %}"><span>{% trans "Restore from Remote" %}</span></a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div><!-- .sidebar-submenu -->
|
</div><!-- .sidebar-submenu -->
|
||||||
|
|||||||
Reference in New Issue
Block a user