Sentora Support Forums
Old issue on Daily Backup - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: Old issue on Daily Backup (/showthread.php?tid=1724)

Pages: 1 2 3


Old issue on Daily Backup - iraqiboy90 - 06-30-2015

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?


RE: Old issue on Daily Backup - iraqiboy90 - 07-01-2015

http://www.robgroen.nl/content/zpanel-creates-multiple-backups-one-day


RE: Old issue on Daily Backup - TGates - 07-01-2015

From the link above: ( http://www.robgroen.nl/content/zpanel-creates-multiple-backups-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.



RE: Old issue on Daily Backup - iraqiboy90 - 07-19-2015

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


RE: Old issue on Daily Backup - TGates - 07-21-2015

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?


RE: Old issue on Daily Backup - iraqiboy90 - 07-23-2015

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.


RE: Old issue on Daily Backup - TGates - 07-24-2015

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.


RE: Old issue on Daily Backup - iraqiboy90 - 07-24-2015

Last Day Daemon Run: 18:10 22nd Jul 2015 BST

How do I fix this?


RE: Old issue on Daily Backup - TGates - 07-24-2015

It runs everyday at midnight, so the day will change then. (today being the 23rd) Check it tomorrow and see if it is 23rd...


RE: Old issue on Daily Backup - iraqiboy90 - 07-25-2015

I said that it does it every day....
Last Day Daemon Run: 18:15 24th Jul 2015 BST