mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
increase backup file holder name size
This commit is contained in:
@@ -480,25 +480,25 @@ class backupUtilities:
|
||||
rmtree(tempStoragePath)
|
||||
|
||||
###
|
||||
backupFileNamePath = os.path.join(backupPath, "backupFileName")
|
||||
fileName = open(backupFileNamePath, 'r').read()
|
||||
|
||||
backupObs = Backups.objects.filter(fileName=fileName)
|
||||
backupObs = Backups.objects.filter(fileName=backupName)
|
||||
|
||||
## adding backup data to database.
|
||||
|
||||
filePath = '%s/%s.tar.gz' % (backupPath, backupName)
|
||||
totalSize = '%sMB' % (str(int(os.path.getsize(filePath) / 1048576)))
|
||||
|
||||
try:
|
||||
for items in backupObs:
|
||||
items.status = 1
|
||||
items.size = str(int(float(
|
||||
os.path.getsize(os.path.join(backupPath, backupName + ".tar.gz"))) / (
|
||||
1024.0 * 1024.0))) + "MB"
|
||||
items.size = totalSize
|
||||
items.save()
|
||||
except:
|
||||
logging.CyberCPLogFileWriter.writeToFile(' again size: %s' % (totalSize))
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile('%s. [backupRoot:499]' % str(msg))
|
||||
for items in backupObs:
|
||||
items.status = 1
|
||||
items.size = str(int(float(
|
||||
os.path.getsize(os.path.join(backupPath, backupName + ".tar.gz"))) / (
|
||||
1024.0 * 1024.0))) + "MB"
|
||||
items.size = totalSize
|
||||
items.save()
|
||||
|
||||
command = 'chmod 600 %s' % (os.path.join(backupPath, backupName + ".tar.gz"))
|
||||
|
||||
@@ -579,6 +579,11 @@ class Upgrade:
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
cursor.execute("ALTER TABLE websiteFunctions_backups MODIFY fileName varchar(200)")
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
try:
|
||||
cursor.execute("ALTER TABLE loginSystem_acl ADD COLUMN listUsers INT DEFAULT 0;")
|
||||
|
||||
@@ -29,7 +29,7 @@ class ChildDomains(models.Model):
|
||||
|
||||
class Backups(models.Model):
|
||||
website = models.ForeignKey(Websites,on_delete=models.CASCADE)
|
||||
fileName = models.CharField(max_length=50)
|
||||
fileName = models.CharField(max_length=200)
|
||||
date = models.CharField(max_length=50)
|
||||
size = models.CharField(max_length=50)
|
||||
status = models.IntegerField(default=0)
|
||||
|
||||
Reference in New Issue
Block a user