Sentora Support Forums
I need to change when backups run - 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: I need to change when backups run (/showthread.php?tid=4166)

Pages: 1 2


I need to change when backups run - Shasta.com - 10-31-2017

I need to change when the backups run from daily at midnight to Sunday at 1:00am.

Currently the backup setting do not have a provision for this. I can turn off the daily backups, but I am not sure how to fire them off myself. I have done some digging around, and i think I might be able to add a cron job that calls /etc/sentora/panel/modules/backup_admin/hooks/OnDaemonDay.hook.php, but I am not sure what happens if I run that file manually.

How do I go about doing this? Thank you.


RE: I need to change when backups run - Me.B - 10-31-2017

The startup time for backup is stored under sentora db settings.

M B


RE: I need to change when backups run - wormsunited - 10-31-2017

(10-31-2017, 06:42 AM)Shasta.com Wrote: I need to change when the backups run from daily at midnight to Sunday at 1:00am.

Currently the backup setting do not have a provision for this. I can turn off the daily backups, but I am not sure how to fire them off myself. I have done some digging around, and i think I might be able to add a cron job that calls /etc/sentora/panel/modules/backup_admin/hooks/OnDaemonDay.hook.php, but I am not sure what happens if I run that file manually.

How do I go about doing this? Thank you.

A cron job also can do that for you mate!


RE: I need to change when backups run - Shasta.com - 11-01-2017

(10-31-2017, 01:23 PM)wormsunited Wrote: A cron job also can do that for you mate!

Thanks for your reply, but your reply just restated my question without providing any answer.

What happens when I run /etc/sentora/panel/modules/backup_admin/hooks/OnDaemonDay.hook.php manually? Is this the script I want to run from the cron job?

(10-31-2017, 07:38 AM)Me.B Wrote: The startup time for backup is stored under sentora db settings.

M B

Wonderful, but where? When I go to: Database: sentora_core » Table: x_settings I see no field relating to backup or the scheduling thereof either. I have also looked all all the other tables in the sentora_core database and not found anything that resembles what I think I would be looking for.


RE: I need to change when backups run - Me.B - 11-01-2017

it's a timestamp @[TGates]


RE: I need to change when backups run - Shasta.com - 11-01-2017

(11-01-2017, 01:46 AM)Me.B Wrote: it's a timestamp @[TGates]

Oh yes, the whole UNIX timestamp thing I read about in another thread. Now, just how does that change my backup from daily to once a week on Sunday again? I'm pretty sure it doesn't. All it can do is change when during the day it happens.


RE: I need to change when backups run - TGates - 11-01-2017

If I remember correctly it is not in the DB. It uses the OnDaemonDayRun.hook and runs every night at midnight.
The timing is hard coded into the module. Looking into it now.

This is a required fix for the backups manager if you have not done it yet: http://forums.sentora.org/showthread.php?tid=2065&pid=13220#pid13220

Still looking for the timing routine...


RE: I need to change when backups run - Shasta.com - 11-01-2017

(11-01-2017, 03:30 AM)TGates Wrote: If I remember correctly it is not in the DB. It uses the OnDaemonDayRun.hook and runs every night at midnight.
The timing is hard coded into the module. Looking into it now.

This is a required fix for the backups manager if you have not done it yet: http://forums.sentora.org/showthread.php?tid=2065&pid=13220#pid13220

Still looking for the timing routine...

Thank you.

I have replaced the two files mentioned in the linked thread with the new versions.

I will wait to hear how I can schedule when this is called on my own via cron.


RE: I need to change when backups run - TGates - 11-01-2017

I can't seem to find the code anywhere. But it had to do with changing the OnDaemonDay.hook.php to OnDaemonWeek.hook.php and some timestamp changes.

But that would not run at the time you specifically want.

To run a backup at your specific time, @[Me.B]'s custom bash script may be what you need: https://github.com/MBlagui/Sentora-tools/blob/master/backupuserfiles.sh


RE: I need to change when backups run - Shasta.com - 11-01-2017

(11-01-2017, 05:21 AM)TGates Wrote: I can't seem to find the code anywhere. But it had to do with changing the OnDaemonDay.hook.php to OnDaemonWeek.hook.php and some timestamp changes.

But that would not run at the time you specifically want.

To run a backup at your specific time, @[Me.B]'s custom bash script may be what you need: https://github.com/MBlagui/Sentora-tools/blob/master/backupuserfiles.sh

I preliminary look through of @[Me.B]'s script makes me think this is the route for me to take.

Currently this install is a KVM VM on the same ProxMox server as 5 CloudLinux/cPanel VMs and a Windows 2016/Plesk VM. I made the mistake of making my image storage drive a raw ZFS ZRAID1 block storage. I need to rebuilt the whole thing as a ZRAID Stripe+Mirror mounted as a directory. Until I do, I/O Delay is killing me and I have to ensure that no two VMs are performing either an upgrade or backup at the same time.

Thank you for your help. If I need further assistance, I am sure I will be back. Otherwise I will report back with my results.