Skip to content
Permalink
Browse files
bug fix: one backup job to not span multiple directories
  • Loading branch information
usmannasir committed Jan 18, 2020
1 parent 21bcc7f commit fd707c1eb5a0e5c5a78f79b5d11febe4775a84e5
Showing with 5 additions and 3 deletions.
  1. +5 −3 plogical/backupScheduleLocal.py
@@ -22,15 +22,17 @@ class backupScheduleLocal:
localBackupPath = '/home/cyberpanel/localBackupPath'
now = datetime.now()


@staticmethod
def prepare():
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")

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, "")
@@ -43,7 +45,7 @@ def prepare():

if os.path.exists(backupScheduleLocal.localBackupPath):
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)
ProcessUtilities.normalExecutioner(command)

0 comments on commit fd707c1

Please sign in to comment.