Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Limit Backups by Disk Space and Inode count

Xavior82 shared this idea 12 years ago
Open Discussion

I would like for there to be an option to limit automated and/or self-generated backups once the user's account surpasses an adminstrator-defined disk space and/or inode limit.


This should improve performance and stability overall, by preventing backups from being generated for overly large accounts without direct admin intervention.

Replies (18)

photo
1

Their is already a place to enable inodes display ( for cpanel )

Tweek Settings> Display > Display File Usage


Information in the cPanel stats bar (inode count)

But i dont see where i can add a max limit of files aloud.

photo
7

Having the option to disable backups for accounts bigger than x GB or with more than x inodes, would be great!

photo
2

Inode count is already displayed on cpanel ....

If you tell me WHERE is this stored, I can code some script/cron for backups like this (but using inodes, instead of disk space, or use combination of both).

It would be GREAT if someone do a plugin or cpanel intergates this into the backup and/or packages (inode limitations, or backup disable by default inode/space value, plus a way to allow more on specified users) it should not be hard to do for them.


  1. #!/bin/bash
  2. max_size="2097152" # This is 2097152KB or 2GB
  3. for u in `ls /var/cpanel/users/`;
  4. do
  5. size=$(repquota -a | grep ${u}|awk '{print $3}'|sort -k 1 -nr|head -1);
  6. if [ "${size}" -ge "${max_size}" ];
  7. then
  8. echo "${u}" >> /tmp/cpbackup-userskip.conf;
  9. fi;
  10. done;
  11. sort -u /tmp/cpbackup-userskip.conf /etc/cpbackup-userskip.conf > /tmp/cpbackup-userskip.conf.uniq;
  12. cp -f /tmp/cpbackup-userskip.conf.uniq /etc/cpbackup-userskip.conf;
  13. rm -f /tmp/cpbackup-userskip.conf*;

photo
2

This would be extremely helpful. We had some custom coding that threw a size error if your account was more than a certain size, but that seems to not work with the new backup mechanism.


Even a way to disable user generated backups by username would help at his point. :) Maybe an exclude user file as suggested by CAS above that can be edited to add users...

photo
1

Agreed!


We have scripts in place for this already but maintaining them is problematic. Love to see this one.

photo
1

would love to see this as well.

photo
2

I would want to limit backups when they reach a set amount of disk space / Inodes.

photo
1

As storage space has become cheaper this has become a MAJOR problem - especially when selling 'unlimited' style accounts.

photo
3

Not developed yet? :(


I vote on an option in legacy and new backup system that says Don´t backup accounts over X MB or GB. It´s not worth backing up accounts over 5 ~ 10GB.

photo
1

It will be nice to see this feature.

cPanel team can provide us a simple answer ?

It will be or not implemented after all ?

photo
1

Hello, in your proposal does "package size limit" refer to the account disk quota?

photo
1

Yes .


you can edit my post and re-phrse my question by the adequate words .

photo
1

I think this is a tough feature. It will benefit some people and difficult the life of others:


Pros:

- Your server won't be overwhelmed by allocating lots of backups made unintendedly by some users. So you won't be allocating disk space to resources being curently unpaid.


Cons:

- Some users may not count with reliable backups due to their disk package limitations.


So, I think we would need a middle ground because vast majority of users make a full manual backup when they really need it.


I think the best approach would be the following:

- Keep the current way of storing backups (not counting against account quota)

- 15 days after backup creation date, its owner should be changed to the account's one so it starts counting against disk quota.

- And obviously make clear to the user in the UI what will happen with it. "Your cPanel backup files will add to your usage disk quota since [calculate date: today+15d]"

- Also, the process should apply the new owner to any compressed file (*.gz, *.zip) within the account folder to avoid witty users who may have renamed the backup file to skip this feature.


Another option would be to offer options to the user when creating the backup:

- Auto delete this file after 15 days. (default option)

- Start counting this filesize against your disk quota after 15 days.


I think this last option would force people to download the backup in order to keep it safe, or rebuild it when they really need it again.


What do you think guys?

Best regards

photo
photo
1

Sounds complicated to manage from a customer support point of view. In case of a server crash your customer would loose all his files because he has too many of them. Instead of warning your customer he has too many files, shouldn't you limit the size of his account to correspond to thee amount of backup you include ?

photo
1

Hope this comes in the next time.... would reduce workload.

photo
1

Thanks for noticing that! I've merged the three.

photo
1

Does merging them merge all the votes as well?

photo
1

Yup.

photo
1

sweet :)

photo
photo
1

Please add to this, a warning that appears in the user's cPanel, and / or an email sent to the contact address with notification of the same.

photo
1

Also it would be nice if there was an API call for this to check if backups were enabled / disabled for an account with reason for the same. That way we can put notifications in our billing panels and internal mailing systems and not just the one in cPanel which some users may never see.


e.g.

enabled=0

reason=Inodes exceed quota

reason=Manually excluded

reason=Disk exceeds quota

photo
1

This would be a separate feature, needing its own request on the site.

photo
photo
2

Hello,


Please add this feature. On my job I control more than 30 servers and this option will save me a lot of time.

photo
1

I would also like this option to prevent users using too much space simply by backing up their files multiple times.

Leave a Comment
 
Attach a file