uk01

Well-Known Member
Dec 31, 2009
223
33
78
Hi quick question, do you know if it's ok to rm -rf an incremental backup folder?

Eg one of our backup servers is smaller than the other and Cpanel do not allow us to control what goes to what additional destination.

Therefore we sometimes go in and rm -rf /xxxx/monthly/2019-**-** to get rid of some older monthly backups on one server.

I realise incremental works with hard links and we are deleting the oldest folders which probably contain original data. Does rm -rf respect hard links, for eg if some newer monthly folders are linking to older unchanged files?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,273
1,281
313
Houston
This absolutely should not be done for incremental backups. rm -rf doesn't differentiate between files, what you're doing is forcing removal of all data within those folders. The retention settings for backups can be modified to retain fewer backups or alternatively you could utilize compressed backups rather than incremental.

Another thing you may want to look at is software Like JetBackup which specializes in backups and does allow selecting the backup destination for a specific backup. Create New Backup Job — JetBackup Documentation documentation
 

uk01

Well-Known Member
Dec 31, 2009
223
33
78
Right ok that’s strange as I read the opposite elsewhere and our tests showed ok.

We generated a gzip of an account and checked the size then removed various old backups and gzipped again, same size.

We also read elsewhere that rm -rf does not force removal as they are hard links.

I also read on your own knowledge base, I’ll find the link.

Sorry, no but with your new extremely high prices we will not buy another piece of software to patch Cpanel functionality.

Cheers
 
Last edited:

uk01

Well-Known Member
Dec 31, 2009
223
33
78
Oh just to say compressed is out of the question as in today’s data usage it’s unrealistic.
Generating that amount of data each night has bandwidth and cost/storage implications without even considering the fact 8 hours overnight isn’t enough time.
 

uk01

Well-Known Member
Dec 31, 2009
223
33
78
Last post here from you

Research seems to suggest that
When you delete (rm) a hardlink the filesystem does not remove the inode if it has another link.
As long as you do not delete the last link the file will remain.

So if any backup folder is removed it only removes inodes/data which is not linked to from any of the other folders.

This is why my gzipped account folder stayed the same size in testing as even though I deleted other folders the inodes remained.

Do you not agree?

If not, what commands does cpanel use for pruning?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,273
1,281
313
Houston
Thank you for that, I am apparently not as infallible as I would like to believe and reading How do incremental backups work? I'm actually remembering the following: What is a hard link? -- definition by The Linux Information Project (LINFO).
I am sorry for the confusion, I believe I just (accidentally) confused symlink behavior with hard links - if you delete the target of a symlink you render the symlink useless but the difference in the hard linking is it's no different than the file being in both locations.

So based on my examples there, your proposal to remove the backup should be fine. rm will change the number of links to the new total (if you have 3 backups it would be +3 rm would make it +2)

I do also want to point out in reference to your comments about backups, basic backup functionality is something we provide but when you are looking for more complex solutions cPanel's default backup configuration may not be the best solution for you and I know for certain that this behavior isn't possible with backup configuration as it stands now nor am I aware of a better way to achieve your desired end goal easily. I'd advise you to bring your concerns about pricing to your account manager, while I understand you're unhappy about that, I can't make changes in regard to that.
 

uk01

Well-Known Member
Dec 31, 2009
223
33
78
Thanks Lauren, none of us are perfect, there's so much to remember these days!
Hopefully the information and links here also helps anyone else who finds the thread.

I suppose we all tend to expect more than basic when the price increases 300%, hence my commets on the backups.
I totally understand you have no control over pricing, we have all just been hit very hard but the decision was made.

Appreciate you following up, rm -rf gets us where we need to be on those occasions we need to clear 2 or 3 monthly folders from one smaller backup server.
Cheers ;-)