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