mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
bug fix: one backup job to not span multiple directories
This commit is contained in:
@@ -22,15 +22,17 @@ class backupScheduleLocal:
|
|||||||
localBackupPath = '/home/cyberpanel/localBackupPath'
|
localBackupPath = '/home/cyberpanel/localBackupPath'
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare():
|
def prepare():
|
||||||
try:
|
try:
|
||||||
backupLogPath = "/usr/local/lscp/logs/local_backup_log." + time.strftime("%m.%d.%Y_%H-%M-%S")
|
backupRunTime = time.strftime("%m.%d.%Y_%H-%M-%S")
|
||||||
|
backupLogPath = "/usr/local/lscp/logs/local_backup_log." + backupRunTime
|
||||||
|
|
||||||
writeToFile = open(backupLogPath, "a")
|
writeToFile = open(backupLogPath, "a")
|
||||||
|
|
||||||
backupSchedule.remoteBackupLogging(backupLogPath, "#################################################")
|
backupSchedule.remoteBackupLogging(backupLogPath, "#################################################")
|
||||||
backupSchedule.remoteBackupLogging(backupLogPath," Local Backup log for: " + time.strftime("%m.%d.%Y_%H-%M-%S"))
|
backupSchedule.remoteBackupLogging(backupLogPath," Local Backup log for: " + backupRunTime)
|
||||||
backupSchedule.remoteBackupLogging(backupLogPath, "#################################################\n")
|
backupSchedule.remoteBackupLogging(backupLogPath, "#################################################\n")
|
||||||
|
|
||||||
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
||||||
@@ -43,7 +45,7 @@ class backupScheduleLocal:
|
|||||||
|
|
||||||
if os.path.exists(backupScheduleLocal.localBackupPath):
|
if os.path.exists(backupScheduleLocal.localBackupPath):
|
||||||
backupPath = retValues[1] + ".tar.gz"
|
backupPath = retValues[1] + ".tar.gz"
|
||||||
localBackupPath = '%s/%s' % (open(backupScheduleLocal.localBackupPath, 'r').read().rstrip('/'), time.strftime("%b-%d-%Y"))
|
localBackupPath = '%s/%s' % (open(backupScheduleLocal.localBackupPath, 'r').read().rstrip('/'), backupRunTime)
|
||||||
|
|
||||||
command = 'mkdir -p %s' % (localBackupPath)
|
command = 'mkdir -p %s' % (localBackupPath)
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|||||||
Reference in New Issue
Block a user