Anyway to limit the complete backup function?

zigzam

Well-Known Member
May 9, 2005
206
0
166
Im currently having issues with users backing up 5 Gb sites during peak hours causing the server load to sky rocket. Or users backing up 20 sites at once causing high load.

Is there a way to limit when the complete backups can be made? or if one is running not have another start until the first finishes.

If there isnt a way, how can I disable that function?
 

eth00

Well-Known Member
PartnerNOC
Mar 30, 2003
721
1
168
NC
cPanel Access Level
Root Administrator
Short of a script that chmod 000's the cpbackup file and having the users get an error there is not a way.

You can disable it somehow in WHM, I forget exactly probably tweak settings.
 

panayot

Well-Known Member
Nov 18, 2004
127
0
166
I have the same problem. I was thinking to put a cronjob that turns off backup feature in cpanel during the day and restores it at night.

The file to edit with the two cronjobs would be /var/cpanel/features/disabled

Then edit backup=1 <-> backup=0 with cron.

I am not sure if it would not be better to just force them to use ftp to backup files. But I do not know how to disable other backups and leave only database backups.
 

zigzam

Well-Known Member
May 9, 2005
206
0
166
It has 2 GB Ram and never goes over 1 GB. It doesn't matter how much ram you have when someone starts five 2 GB backups at once.
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
It doesn't matter how much ram you have when someone starts five 2 GB backups at once.
Impossible to argue with that :) Although I think you'll find the memory use gets pretty high with numerous backups running at once.

You might be able to replace cpbackup with a perl script that uses semaphores to prevent more than a certain number running at once, then calls the real cpbackup. That should work well, although you'd have to guard against the script being overwritten. Or another mechanism would be to queue the backup and have another process run backups from the queue one after the other. Still simpler is to do as you've proposed and just turn off backups completely or during certain hours.