incremental backup: exclude repo folder

This commit is contained in:
Usman Nasir
2019-10-28 12:18:19 +05:00
parent 683ada6f01
commit 71c97e0631
7 changed files with 763 additions and 221 deletions

408
.idea/workspace.xml generated
View File

@@ -28,56 +28,96 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<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">
<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" />
<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>
</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>
<element signature="e#20255#22112#0" />
<element signature="e#22521#24394#0" />
<element signature="e#24458#26343#0" />
<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>
</file>
<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">
<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 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>
</file>
<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">
<state relative-caret-position="292">
<caret line="355" column="48" selection-start-line="355" selection-start-column="48" selection-end-line="355" selection-end-column="48" />
<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#5347#7486#0" />
<element signature="e#7404#8499#0" />
<element signature="e#8540#9296#0" />
<element signature="e#9472#12776#0" />
<element signature="e#14319#15920#0" />
<element signature="e#15985#16779#0" />
<element signature="e#16825#18660#0" />
<element signature="e#18710#19389#0" />
<element signature="e#19428#21357#0" />
<element signature="e#21399#24129#0" />
<element signature="e#24170#24855#0" />
<element signature="e#24902#26851#0" />
<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>
</file>
<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">
<state relative-caret-position="367">
<caret line="47" column="33" selection-start-line="47" selection-start-column="33" selection-end-line="47" selection-end-column="33" />
<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>
@@ -94,11 +134,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>setupVirtualEnv</find>
<find>python</find>
<find>setupDKIM</find>
<find>submitWebsiteCreation</find>
<find>submitWebsitecrea</find>
<find>createDomain</find>
<find>submitDomain</find>
<find>getpass</find>
@@ -121,9 +156,14 @@
<find>emailForwarding</find>
<find>emailFor</find>
<find>selectForwardingEmail</find>
<find>getEmailsForDomain</find>
<find>submitForwardDeletion</find>
<find>getEmailsForDomain</find>
<find>forwardEmail</find>
<find>export</find>
<find>restoreRemoteBackupsInc</find>
<find>backupData</find>
<find>backupData(</find>
<find>sftpFunction</find>
</findStrings>
<replaceStrings>
<replace>admin.api == 1</replace>
@@ -154,7 +194,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/managePHP/ubuntuphp73.xml" />
<option value="$PROJECT_DIR$/plogical/applicationInstaller.py" />
<option value="$PROJECT_DIR$/plogical/cPanelImporter.py" />
<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$/s3Backups/s3Backups.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/static/IncBackups/IncBackups.js" />
<option value="$PROJECT_DIR$/CyberCP/secMiddleware.py" />
<option value="$PROJECT_DIR$/plogical/mysqlUtilities.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/createBackup.html" />
<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$/install/firewallUtilities.py" />
<option value="$PROJECT_DIR$/IncBackups/views.py" />
<option value="$PROJECT_DIR$/preUpgrade.sh" />
<option value="$PROJECT_DIR$/plogical/upgrade.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/templates/mailServer/emailForwarding.html" />
<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>
</option>
</component>
@@ -229,7 +269,33 @@
<path>
<item name="CyberCP" type="b2602c69:ProjectViewProjectNode" />
<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>
</expand>
<select />
@@ -239,22 +305,22 @@
</component>
<component name="PropertiesComponent">
<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_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/websiteFunctions" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/IncBackups" />
<recent name="$PROJECT_DIR$/IncBackups/templates/IncBackups" />
<recent name="$PROJECT_DIR$/IncBackups" />
<recent name="$PROJECT_DIR$/dns/templates/dns" />
<recent name="$PROJECT_DIR$/mailServer/templates/mailServer" />
<recent name="$PROJECT_DIR$/packages/templates/packages" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/websiteFunctions" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
@@ -443,18 +509,18 @@
<workItem from="1571158869749" duration="705000" />
<workItem from="1571160353900" duration="938000" />
<workItem from="1571162569598" duration="21905000" />
<workItem from="1572178630393" duration="2931000" />
<workItem from="1572178630393" duration="10211000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="733682000" />
<option name="totallyTimeSpent" value="740962000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="25" width="1366" height="684" extended-state="6" />
<editor active="true" />
<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="Favorites" order="2" side_tool="true" />
<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" />
</component>
<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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
@@ -591,16 +636,6 @@
</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="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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="227">
@@ -741,13 +776,6 @@
</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="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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184">
@@ -755,26 +783,6 @@
</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="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">
<provider selected="true" editor-type-id="text-editor" />
</entry>
@@ -785,13 +793,6 @@
</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="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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
@@ -809,42 +810,6 @@
</state>
</provider>
</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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="247">
@@ -1197,25 +1162,6 @@
</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="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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="292">
@@ -1237,5 +1183,131 @@
</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$/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>
</project>

View File

@@ -2,10 +2,12 @@
import os
import os.path
import sys
sys.path.append('/usr/local/CyberCP')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
import django
try:
django.setup()
except:
@@ -25,12 +27,16 @@ from plogical.backupUtilities import backupUtilities
from plogical.dnsUtilities import DNS
from mailServer.models import Domains as eDomains
from random import randint
import json
from django.shortcuts import HttpResponse
try:
from plogical.virtualHostUtilities import virtualHostUtilities
from plogical.mailUtilities import mailUtilities
except:
pass
class IncJobs(multi.Thread):
def __init__(self, function, extraArgs):
@@ -51,6 +57,72 @@ class IncJobs(multi.Thread):
self.createBackup()
elif self.function == '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):
key = self.backupDestinations.split('/')[-1]
@@ -58,22 +130,24 @@ class IncJobs(multi.Thread):
secret = open(path, 'r').read()
return key, secret
def awsFunction(self, fType, backupPath = None, snapshotID = None, bType = None):
def awsFunction(self, fType, backupPath=None, snapshotID=None, bType=None):
try:
if fType == 'backup':
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' % (
key, secret, self.website.domain, backupPath, self.passwordFile)
key, secret, self.website.domain, backupPath, self.passwordFile)
result = ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.statusPath, result, 1)
snapShotid = result.split(' ')[-2]
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,
destination=self.backupDestinations)
else:
newSnapshot = JobSnapshots(job=self.jobid, type='%s:%s' % (bType, backupPath), snapshotid=snapShotid,
destination=self.backupDestinations)
newSnapshot = JobSnapshots(job=self.jobid, type='%s:%s' % (bType, backupPath),
snapshotid=snapShotid,
destination=self.backupDestinations)
newSnapshot.save()
else:
self.backupDestinations = self.jobid.destination
@@ -88,9 +162,9 @@ class IncJobs(multi.Thread):
logging.statusWriter(self.statusPath, "%s [88][5009]" % (str(msg)), 1)
return 0
def localFunction(self, backupPath, type, restore = None):
def localFunction(self, backupPath, type, 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)
logging.statusWriter(self.statusPath, result, 1)
snapShotid = result.split(' ')[-2]
@@ -107,11 +181,11 @@ class IncJobs(multi.Thread):
else:
repoLocation = '/home/%s/incbackup' % (self.website)
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)
logging.statusWriter(self.statusPath, result, 1)
def sftpFunction(self, backupPath, type, restore = None):
def sftpFunction(self, backupPath, type, restore=None):
if restore == None:
remotePath = '/home/backup/%s' % (self.website.domain)
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:
repoLocation = '/home/backup/%s' % (self.website)
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)
logging.statusWriter(self.statusPath, result, 1)
@@ -160,7 +234,8 @@ class IncJobs(multi.Thread):
else:
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
try:
@@ -189,7 +264,6 @@ class IncJobs(multi.Thread):
def reconstructWithMeta(self):
try:
if self.jobid.destination == 'local':
self.localFunction('none', 'none', 1)
elif self.jobid.destination[:4] == 'sftp':
@@ -219,7 +293,6 @@ class IncJobs(multi.Thread):
logging.statusWriter(self.statusPath, message, 1)
self.passwordFile = '/home/%s/%s' % (self.website, self.website)
##
if self.jobid.type[:8] == 'database':
@@ -433,10 +506,11 @@ class IncJobs(multi.Thread):
else:
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
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
def backupDatabases(self):
@@ -461,10 +535,11 @@ class IncJobs(multi.Thread):
try:
os.remove('/home/cyberpanel/%s.sql' % (items.dbName))
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
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
def emailBackup(self):
@@ -480,11 +555,11 @@ class IncJobs(multi.Thread):
else:
self.awsFunction('backup', backupPath, '', 'email')
logging.statusWriter(self.statusPath, 'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
logging.statusWriter(self.statusPath,
'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
return 1
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
def metaBackup(self):
@@ -500,11 +575,11 @@ class IncJobs(multi.Thread):
else:
self.awsFunction('backup', backupPath, '', 'meta')
logging.statusWriter(self.statusPath, 'Meta for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
logging.statusWriter(self.statusPath,
'Meta for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
return 1
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
def initiateRepo(self):
@@ -518,20 +593,23 @@ class IncJobs(multi.Thread):
elif self.backupDestinations[:4] == 'sftp':
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)
logging.statusWriter(self.statusPath, result, 1)
else:
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)
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)
result = ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.statusPath, result, 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
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
def createBackup(self):
@@ -562,7 +640,6 @@ class IncJobs(multi.Thread):
command = 'chmod 600 %s' % (self.passwordFile)
ProcessUtilities.executioner(command)
if self.initiateRepo() == 0:
return
@@ -589,6 +666,7 @@ class IncJobs(multi.Thread):
command = 'rm -f %s' % (metaPathNew)
ProcessUtilities.executioner(command)
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)

View File

@@ -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) {
}
};
});

View 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 %}

View File

@@ -3,6 +3,7 @@ import views
urlpatterns = [
url(r'^createBackup$', views.createBackup, name='createBackupInc'),
url(r'^restoreRemoteBackups$', views.restoreRemoteBackups, name='restoreRemoteBackupsInc'),
url(r'^backupDestinations$', views.backupDestinations, name='backupDestinationsInc'),
url(r'^addDestination$', views.addDestination, name='addDestinationInc'),
url(r'^populateCurrentRecords$', views.populateCurrentRecords, name='populateCurrentRecordsInc'),

View File

@@ -288,36 +288,55 @@ def fetchCurrentBackups(request):
else:
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 = "["
checker = 0
startJob = IncJobs('Dummpy', extraArgs)
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:
includes = '%s,%s:%s' % (includes, job.type, job.snapshotid)
json_data = "["
checker = 0
dic = {'id': items.id,
'date': str(items.date),
'includes': includes
}
for items in reversed(backups):
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:
final_dic = {'status': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
@@ -687,3 +706,32 @@ def scheduleDelete(request):
except BaseException, msg:
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
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)

View File

@@ -604,6 +604,9 @@
<li class="restoreBackup"><a href="{% url 'scheduleBackupsInc' %}"
title="{% trans 'Schedule Back ups' %}"><span>{% trans "Schedule Back ups" %}</span></a>
</li>
<li class="remoteBackups"><a href="{% url 'restoreRemoteBackupsInc' %}"
title="{% trans 'Restore from Remote Server' %}"><span>{% trans "Restore from Remote" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->