Skip to content

Commit dd8cd6f

Browse files
committed
table for scheduled backup logs
1 parent f3322cd commit dd8cd6f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

plogical/backupScheduleLocal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
from re import match,I,M
1818
import signal
1919
from datetime import datetime
20+
from websiteFunctions.models import BackupJob, BackupJobLogs
2021

2122
class backupScheduleLocal:
2223
localBackupPath = '/home/cyberpanel/localBackupPath'
2324
now = datetime.now()
2425

25-
2626
@staticmethod
2727
def prepare():
2828
try:

plogical/upgrade.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,8 @@ def IncBackupMigrations():
12431243
`logFile` varchar(1000) NOT NULL,
12441244
`ipAddress` varchar(50) NOT NULL,
12451245
`port` varchar(15) NOT NULL,
1246+
`jobFailedSites` int(11) NOT NULL,
1247+
`jobSuccessSites` int(11) NOT NULL,
12461248
PRIMARY KEY (`id`)
12471249
)"""
12481250
try:
@@ -1255,6 +1257,7 @@ def IncBackupMigrations():
12551257
`id` int(11) NOT NULL AUTO_INCREMENT,
12561258
`message` longtext NOT NULL,
12571259
`owner_id` int(11) NOT NULL,
1260+
`status` int(11) NOT NULL,
12581261
PRIMARY KEY (`id`),
12591262
KEY `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` (`owner_id`),
12601263
CONSTRAINT `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_backupjob` (`id`)

websiteFunctions/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ class BackupJob(models.Model):
5353
logFile = models.CharField(max_length=1000)
5454
ipAddress = models.CharField(max_length=50)
5555
port = models.CharField(max_length=15)
56+
jobSuccessSites = models.IntegerField()
57+
jobFailedSites = models.IntegerField()
5658

5759
class BackupJobLogs(models.Model):
5860
owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE)
61+
status = models.IntegerField()
5962
message = models.TextField()

0 commit comments

Comments
 (0)