mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-07 20:43:44 +02:00
Merge branch 'v2.0.4-dev' of github.com:usmannasir/cyberpanel into v2.0.4-dev
This commit is contained in:
@@ -22,6 +22,7 @@ class cliParser:
|
||||
parser.add_argument('--dkim', help='DKIM Signing')
|
||||
parser.add_argument('--openBasedir', help='To enable or disable open_basedir protection for domain.')
|
||||
parser.add_argument('--fileName', help='Complete path to a file that needs to be restored.')
|
||||
parser.add_argument('--backupPath', help='Backup path to use when generating a backup.')
|
||||
|
||||
## Package Arguments.
|
||||
|
||||
@@ -69,4 +70,4 @@ class cliParser:
|
||||
parser.add_argument('--siteTitle', help='Site Title for application installers.')
|
||||
parser.add_argument('--path', help='Path for application installers.')
|
||||
|
||||
return parser.parse_args()
|
||||
return parser.parse_args()
|
||||
|
||||
@@ -333,13 +333,22 @@ class cyberPanel:
|
||||
|
||||
## Backup Functions
|
||||
|
||||
def createBackup(self, virtualHostName):
|
||||
def createBackup(self, virtualHostName, backupPath=None):
|
||||
try:
|
||||
backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%I-%M-%S-%a-%b-%Y")
|
||||
# Setup default backup path to /home/<domain name>/backup if not passed in
|
||||
if backupPath is None:
|
||||
backupPath = '/home/' + virtualHostName + '/backup'
|
||||
|
||||
# remove trailing slash in path
|
||||
backupPath = backupPath.rstrip("/")
|
||||
backuptime = time.strftime("%m.%d.%Y_%H-%M-%S")
|
||||
backupLogPath = "/usr/local/lscp/logs/backup_log." + backuptime
|
||||
|
||||
print('Backup logs to be generated in %s' % (backupLogPath))
|
||||
|
||||
backupSchedule.createLocalBackup(virtualHostName, backupLogPath)
|
||||
tempStoragePath = backupPath + '/backup-' + virtualHostName + '-' + backuptime
|
||||
backupName = 'backup-' + virtualHostName + '-' + backuptime
|
||||
backupDomain = virtualHostName
|
||||
backupUtilities.submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain)
|
||||
|
||||
except BaseException as msg:
|
||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||
|
||||
Reference in New Issue
Block a user