This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Old issue on Daily Backup
#1
Old issue on Daily Backup
Hello

I enabled the daily backup on my sites yesterday and today all my sites were closed because it was full.
Found out that the backup kept doing backups until the hosting space was full...

I remember this issue from Zpanel, and a guy showed a fix by modifying a file to make Sentora/Zpanel "wait" longer to determine if the first backup were made or not.

Does anyone remember it?
Reply
Thanks given by:
#2
RE: Old issue on Daily Backup
http://www.robgroen.nl/content/zpanel-cr...ps-one-day
Reply
Thanks given by:
#3
RE: Old issue on Daily Backup
From the link above: ( http://www.robgroen.nl/content/zpanel-cr...ps-one-day )
Pasted here in case something happens on that site. I will also test out the code and push the changes to github if successful.
Quote:ZPanel creates multiple backups on one day
Suddenly my ZPanel began making multiple backups on one day. Looking at the filename of the backup it looks like the backups are made 1 sec after another.
Backup has file names like this

Code:
zadmin_Oct-18-2014_051006.zip
zadmin_Oct-18-2014_051007.zip
zadmin_Oct-18-2014_051008.zip


Actually the file are not made 1 sec after another but 5 minutes. Looking at the file system in the backup directories confirm that. So why is the filename telling me something others than that? There is a bug in the script that defines the filename.

Minutes
Using the date php date format character hms is not hour minute seconds but hours month seconds So changing the "m" into a "i" gives you the minutes.
Hour
Also the hours are wrong defined "h" gives me the 01-12 hour definition without AM or PM. So i think 00-23 in this case is better. Change the "h" into a "H" for 24 hour definition in the time.
Seconds
Seconds "s" is OK

Code:
cd /etc/zpanel/panel/modules/backup_admin/hook
cp OnDaemonDay.hook.php  OnDaemonDay.hook.php.$(date +%Y%m%d-%H%m%S)
vi OnDaemonDay.hook.php


Change line 34 from

Code:
$backupname = $username . "_" . date("M-d-Y_hms", time());


to

Code:
$backupname = $username . "_" . date("M-d-Y_His", time());


Actually I suppose the multi backup issue is triggered if the total time that is takes to make all backups is longer than the pauses between two cron deamon jobs (default is 5 minutes). This problem is created in /etc/zpanel/panel/bin/daemon.php The dayrun takes more takes 5 minutes and the time is reset after all three jobs are done.
I changes this code to:

Code:
if (ctrl_options::GetSystemOption('daemon_dayrun') < (time() - 86399)) {
    runtime_hook::Execute("OnStartDaemonDay");
    runtime_hook::Execute("OnDaemonDay");
    runtime_hook::Execute("OnEndDaemonDay");
    ctrl_options::SetSystemOption('daemon_dayrun', time());
}


This:

Code:
if (ctrl_options::GetSystemOption('daemon_dayrun') < (time() - 86399)) {
    ctrl_options::SetSystemOption('daemon_dayrun', time());
    runtime_hook::Execute("OnStartDaemonDay");
    runtime_hook::Execute("OnDaemonDay");
    runtime_hook::Execute("OnEndDaemonDay");
}


Just moved the line ctrl_options::SetSystemOption('daemon_dayrun', time()); up three lines.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#4
RE: Old issue on Daily Backup
Thanks. Waiting for more info by you.
I still havn't done the modification because it looks a bit different from how I remember it
Reply
Thanks given by:
#5
RE: Old issue on Daily Backup
Confused  It seemed to work for a day or two then for some reason my daemon stopped running properly, if at all. (Tested on Windows) I did not get multiple backups per day, so that part is fixed. Just need to figure out why it messed up the daemon run. Has anybody else tried this?
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#6
RE: Old issue on Daily Backup
I did.
Not sure what you mean by stopped working properly. Not sure how to notice it myself...
but either way, the backups seems to have worked fine for two days (one backup every day), but I had to stop the daily backup because they were being performed at between 5-7PM every day. That's when usually the peak of the website is...

Not knowing how to change the time of the daily backup, the above option was my only one.
Reply
Thanks given by:
#7
RE: Old issue on Daily Backup
It is supposed to be triggered on the daily daemon run which runs at midnight. You can check the daemon run in the Sentora Config at the bottom.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#8
RE: Old issue on Daily Backup
Last Day Daemon Run: 18:10 22nd Jul 2015 BST

How do I fix this?
Reply
Thanks given by:
#9
RE: Old issue on Daily Backup
It runs everyday at midnight, so the day will change then. (today being the 23rd) Check it tomorrow and see if it is 23rd...
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#10
RE: Old issue on Daily Backup
I said that it does it every day....
Last Day Daemon Run: 18:15 24th Jul 2015 BST
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Security issue urgent johnnyp 7 12 ,540 02-27-2020, 06:19 PM
Last Post: johnnyp
Restore mysql database backup to new Sentora kevwebbie 3 8 ,136 09-30-2019, 09:50 PM
Last Post: kevwebbie
sub-domain issue kevwebbie 15 29 ,572 12-21-2018, 05:51 PM
Last Post: kevwebbie

Forum Jump:


Users browsing this thread: 1 Guest(s)