Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
e115197
JE-71293
sych74 Sep 17, 2024
579259e
JE-71293
sych74 Sep 17, 2024
6141b88
JE-71293
sych74 Sep 17, 2024
198a4c8
JE-71293
sych74 Sep 17, 2024
f2aa75d
JE-71293
sych74 Sep 17, 2024
5c7adc4
JE-71293
sych74 Sep 17, 2024
f66c3b8
JE-71298
sych74 Sep 18, 2024
5b83b69
JE-71297
sych74 Sep 18, 2024
2a10a68
JE-71297
sych74 Sep 18, 2024
5ed79e6
JE-71297
sych74 Sep 18, 2024
c397bbc
JE-71297
sych74 Sep 18, 2024
247b0a9
JE-71293
sych74 Sep 18, 2024
8682477
JE-71293
sych74 Sep 18, 2024
4436d75
JE-71293
sych74 Sep 18, 2024
f0c669c
JE-71293
sych74 Sep 18, 2024
403f7a5
JE-71293
sych74 Sep 18, 2024
ae63d0d
JE-71293
sych74 Sep 19, 2024
c62eff9
Create test.jps
sych74 Sep 19, 2024
6ca7f79
JE-71293
sych74 Sep 20, 2024
ee720b7
JE-71293
sych74 Sep 23, 2024
edd645e
Update test.jps
sych74 Sep 24, 2024
b10fd54
JE-71293
sych74 Sep 24, 2024
e3ca10a
JE-71293
sych74 Sep 25, 2024
6f1c3a9
JE-71293
sych74 Sep 25, 2024
9c5de3d
JE-71293
sych74 Sep 25, 2024
61b4b8a
Update test.jps
sych74 Sep 25, 2024
79d48ad
JE-71293
sych74 Sep 25, 2024
a145e50
JE-71293
sych74 Sep 26, 2024
433e158
JE-71293
sych74 Sep 30, 2024
b359520
JE-71293
sych74 Oct 1, 2024
894e285
JE-71293
sych74 Oct 1, 2024
17dd978
JE-71293
sych74 Oct 1, 2024
232de06
Create restote-test.sh
sych74 Oct 3, 2024
a43fa02
Update restote-test.sh
sych74 Oct 3, 2024
87fbf7c
Update restote-test.sh
sych74 Oct 3, 2024
9effaa5
Update restote-test.sh
sych74 Oct 3, 2024
ff1fd19
Update restote-test.sh
sych74 Oct 4, 2024
a20fcaa
JE-71293
sych74 Oct 4, 2024
bf7a489
JE-71293
sych74 Oct 10, 2024
2c22f14
JE-71293
sych74 Oct 10, 2024
0c84bd5
JE-71293
sych74 Oct 11, 2024
d5bf93a
JE-71293
sych74 Oct 11, 2024
619988f
JE-71293
sych74 Oct 11, 2024
3c20a2e
JE-71293
sych74 Oct 11, 2024
f8dcaa2
JE-71293
sych74 Oct 11, 2024
ad18fc4
JE-71293
sych74 Oct 11, 2024
36bc385
JE-71293
sych74 Oct 11, 2024
a0cc627
JE-71293
sych74 Oct 11, 2024
ee9aa73
JE-71293
sych74 Oct 15, 2024
ce0e40d
JE-71293
sych74 Oct 15, 2024
9125061
JE-71293
sych74 Oct 15, 2024
cc8a674
JE-71293
sych74 Oct 15, 2024
80f44d4
JE-71293
sych74 Feb 11, 2025
ec5c082
Delete test.jps
sych74 Feb 11, 2025
dc806e0
JE-71293
sych74 Feb 24, 2025
fef9c59
JE-71293
sych74 Feb 24, 2025
31235c3
JE-71293
sych74 Feb 24, 2025
b87192f
JE-71293
sych74 Feb 24, 2025
a08ebff
Create pitrOnBeforeInit.js
sych74 Feb 24, 2025
7e6eabc
JE-71293
sych74 Feb 24, 2025
d407cf3
PITR
sych74 Mar 2, 2025
2fce886
JE-71293
sych74 Mar 2, 2025
766dc13
JE-71293
sych74 Mar 4, 2025
b3b0641
JE-71293
sych74 Mar 4, 2025
50a8b6f
JE-71293
sych74 Mar 4, 2025
acf296c
JE-71293
sych74 Mar 4, 2025
3c56588
JE-73946
sych74 Mar 18, 2025
9bcb844
Update backup.jps
sych74 Mar 18, 2025
8b5fa24
JE-71293
sych74 Mar 18, 2025
89bd1ad
JE-71293
sych74 Mar 18, 2025
d123eed
JE-71293
sych74 Mar 19, 2025
94012b4
JE-71293
sych74 Mar 19, 2025
b9a04e7
JE-71293
sych74 Mar 20, 2025
7e39dca
JE-71293
sych74 Mar 20, 2025
cfa83d6
JE-71293
sych74 Mar 20, 2025
19e5f9a
JE-71293
sych74 Mar 20, 2025
382c03d
JE-73990
sych74 Mar 26, 2025
92c1fe2
Merge remote-tracking branch 'origin/main' into pitr
sych74 Mar 26, 2025
087af32
JE-71293
sych74 Mar 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions backup.jps
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ id: db-backup
targetEditions: any
logo: /images/backup-logo.png
description: Backup Add-On for the database. It can be used to create scheduled backups according to any required timezone and restore corrupted databases, even if the content has been completely deleted.

baseUrl: https://raw.githubusercontent.com/jelastic-jps/database-backup-addon/master
baseUrl: https://raw.githubusercontent.com/sych74/database-backup-addon/pitr

targetNodes:
nodeType:
Expand Down Expand Up @@ -145,6 +144,25 @@ settings:
tooltip: "Always unmount backup storage when backup/restore is finished."
value: false
hidden: false
- type: toggle
name: isPitr
caption: PITR
tooltip: "Enable Point-In-Time Recovery."
value: false
hidden: false
showIf:
true:
- type: displayfield
cls: warning
height: 30,
hideLabel: true,
markup: "Database is not configured for PITR. Click Apply to configure automatically, or close and configure manually following documentation."
- type: displayfield
name: displayPitr
markup: ""
hidden: true
hideLabel: true
cls: warning
- type: displayfield
name: displayfield
markup: Please specify the database user that has enough privileges to access and modify all the databases stored on server. Username and password are required for all the DB servers except Redis.
Expand All @@ -168,6 +186,10 @@ settings:
restore:
fields: []
onBeforeInit: scripts/restoreOnBeforeInit.js

pitr:
fields: []
onBeforeInit: scripts/pitrOnBeforeInit.js

onBeforeInit: scripts/backupOnBeforeInit.js

Expand Down Expand Up @@ -283,6 +305,7 @@ actions:
backupExecNode: ${targetNodes.master.id}
storageEnv: ${response.storageEnvShortName}
isAlwaysUmount: ${this.isAlwaysUmount}
isPitr: ${this.isPitr}
nodeGroup: ${this.nodeGroup}
dbuser: ${this.dbuser}
dbpass: ${this.dbpass}
Expand Down Expand Up @@ -311,9 +334,20 @@ actions:

restore:
- cmd[${targetNodes.nodeGroup}]: |-
rm -f /root/.backupedenv /root/.backuptime /root/.backupid || exit 0;
echo "${settings.backupedEnvName}" > /root/.backupedenv
echo "${settings.backupDir}" > /root/.backupid
user: root
- if ("${settings.isPitr}" == "true"):
- script: |
var dateTimeInput = '${settings.restoreTime}';
var [date, time] = dateTimeInput.split('T');
var formattedDateTime = date + " " + time.slice(0, 5) + ":00";
return {result: 0, formattedDateTime: formattedDateTime};
- cmd[${targetNodes.nodeGroup}]: echo "${response.formattedDateTime}" > /root/.backuptime;
user: root
- else:
- cmd[${targetNodes.nodeGroup}]: echo "${settings.backupDir}" > /root/.backupid;
user: root
- callScript: restore
- deleteDBdump

Expand Down Expand Up @@ -367,6 +401,7 @@ actions:
- setGlobals:
storageEnv: ${settings.storageName}
isAlwaysUmount: ${settings.isAlwaysUmount}
isPitr: ${settings.isPitr}
- if ("${settings.scheduleType}" == 2):
- convert
- else:
Expand All @@ -377,14 +412,21 @@ actions:
- else:
- removePermanentMount
- addPermanentMount
- if ("${settings.isPitr}" == "true"): setupPitr
- installScript:
cronTime: ${globals.cron}
backupCount: ${settings.backupCount}
isAlwaysUmount: ${globals.isAlwaysUmount}
isPitr: ${globals.isPitr}
nodeGroup: ${targetNodes.nodeGroup}
dbuser: ${settings.dbuser}
dbpass: ${settings.dbpass}


setupPitr:
cmd[${nodes.sqldb.master.id}]: |-
wget --tries=10 -O /tmp/pitr.sh ${baseUrl}/scripts/pitr.sh && \
chmod +x /tmp/pitr.sh && /tmp/pitr.sh setupPitr ${settings.dbuser} ${settings.dbpass};

addPermanentMount:
- getStorageCtid
- script: |
Expand Down
Loading