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 from re import match,I,M
import signal import signal
from datetime import datetime from datetime import datetime
from websiteFunctions.models import BackupJob, BackupJobLogs
class backupScheduleLocal: class backupScheduleLocal:
localBackupPath = '/home/cyberpanel/localBackupPath' localBackupPath = '/home/cyberpanel/localBackupPath'
now = datetime.now() now = datetime.now()
@staticmethod @staticmethod
def prepare(): def prepare():
try: try:

View File

@@ -1243,6 +1243,8 @@ class Upgrade:
`logFile` varchar(1000) NOT NULL, `logFile` varchar(1000) NOT NULL,
`ipAddress` varchar(50) NOT NULL, `ipAddress` varchar(50) NOT NULL,
`port` varchar(15) NOT NULL, `port` varchar(15) NOT NULL,
`jobFailedSites` int(11) NOT NULL,
`jobSuccessSites` int(11) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
)""" )"""
try: try:
@@ -1255,6 +1257,7 @@ class Upgrade:
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`message` longtext NOT NULL, `message` longtext NOT NULL,
`owner_id` int(11) NOT NULL, `owner_id` int(11) NOT NULL,
`status` int(11) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `websiteFunctions_bac_owner_id_af3d15f9_fk_websiteFu` (`owner_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`) 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) logFile = models.CharField(max_length=1000)
ipAddress = models.CharField(max_length=50) ipAddress = models.CharField(max_length=50)
port = models.CharField(max_length=15) port = models.CharField(max_length=15)
jobSuccessSites = models.IntegerField()
jobFailedSites = models.IntegerField()
class BackupJobLogs(models.Model): class BackupJobLogs(models.Model):
owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE) owner = models.ForeignKey(BackupJob, on_delete=models.CASCADE)
status = models.IntegerField()
message = models.TextField() message = models.TextField()