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
[Not Solved] 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
[Not Solved] RE: Old issue on Daily Backup
http://www.robgroen.nl/content/zpanel-cr...ps-one-day
Reply
Thanks given by:
#3
[Not Solved] 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 - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support helpful? Donate HERE
Help me to help you by getting your domains using this link:
GoDaddy - Domains
Reply
Thanks given by:
#4
[Not Solved] 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
[Not Solved] 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 - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support helpful? Donate HERE
Help me to help you by getting your domains using this link:
GoDaddy - Domains
Reply
Thanks given by:
#6
[Not Solved] 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
[Not Solved] 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 - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support helpful? Donate HERE
Help me to help you by getting your domains using this link:
GoDaddy - Domains
Reply
Thanks given by:
#8
[Not Solved] 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
[Not Solved] 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 - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support helpful? Donate HERE
Help me to help you by getting your domains using this link:
GoDaddy - Domains
Reply
Thanks given by:
#10
[Not Solved] 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
Remote/FTP/Cloud Backup sonixax 2 525 06-21-2017, 12:10 PM
Last Post: lorexit.com
cron task issue elajam 4 252 06-14-2017, 10:32 PM
Last Post: elajam
Issue Installing Let's Encrypt exlang 1 312 04-29-2017, 12:15 PM
Last Post: exlang

Forum Jump:


Users browsing this thread: 1 Guest(s)