Skip to content

Commit

Permalink
table for scheduled backup logs
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed May 20, 2020
1 parent f3322cd commit dd8cd6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plogical/backupScheduleLocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
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:
Expand Down
3 changes: 3 additions & 0 deletions plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,8 @@ def IncBackupMigrations():
`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:
Expand All @@ -1255,6 +1257,7 @@ def IncBackupMigrations():
`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`)
Expand Down
3 changes: 3 additions & 0 deletions websiteFunctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit dd8cd6f

Please sign in to comment.