table for scheduled backup logs

This commit is contained in:
Usman Nasir
2020-05-20 22:23:21 +05:00
parent f3322cdc91
commit dd8cd6fc2f
3 changed files with 7 additions and 1 deletions

View File

@@ -17,12 +17,12 @@ from plogical.processUtilities import ProcessUtilities
from re import match,I,M
import signal
from datetime import datetime
from websiteFunctions.models import BackupJob, BackupJobLogs
class backupScheduleLocal:
localBackupPath = '/home/cyberpanel/localBackupPath'
now = datetime.now()
@staticmethod
def prepare():
try:

View File

@@ -1243,6 +1243,8 @@ class Upgrade:
`logFile` varchar(1000) NOT NULL,
`ipAddress` varchar(50) NOT NULL,
`port` varchar(15) NOT NULL,
`jobFailedSites` int(11) NOT NULL,
`jobSuccessSites` int(11) NOT NULL,
PRIMARY KEY (`id`)
)"""
try:
@@ -1255,6 +1257,7 @@ class Upgrade:
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` longtext NOT NULL,
`owner_id` int(11) NOT NULL,
`status` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` (`owner_id`),
CONSTRAINT `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_backupjob` (`id`)

View File

@@ -53,7 +53,10 @@ class BackupJob(models.Model):
logFile = models.CharField(max_length=1000)
ipAddress = models.CharField(max_length=50)
port = models.CharField(max_length=15)
jobSuccessSites = models.IntegerField()
jobFailedSites = models.IntegerField()
class BackupJobLogs(models.Model):
owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE)
status = models.IntegerField()
message = models.TextField()