Backups - terminated accounts

eglwolf

Well-Known Member
Jan 1, 2004
190
0
166
I noticed that there are alot of backups in my backups drive from terminated account, when (if ever) does cpanel remove those? Or how best show I deal with them?
 

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
cPanel won't remove those - I think the thinking there is you may need them for restoring purposes, say an account gets deleted by accident :)

You should periodically remove them if you want to free up space, write a script that will get the current users and delete any backups of users that don't exist.

/etc/passwd /etc/trueuserdomains /var/cpanel/users/ are examples of files that can be used to get the current users on the box.
 

Host4u2

Well-Known Member
Mar 24, 2002
247
0
316
See Cpanel Scripts and download "cleanbackups".

This script cleans up old backups. If some of you have noticed cpanel leaves backups of old accounts that have been terminated. This can comsume valuble space. This script runs thru /var/cpanel/users and compares those users with the cpanel backups. If it finds a backup that does not have a user in /var/cpanel/users it takes whatever action you told it to do (Report, or Delete). This script can be run from cron, this script also checks for cpbackup and sleeps until cpbackup stops.
 

coderoyal

Well-Known Member
Mar 8, 2005
58
0
156
I downloaded the script and ran it, but it doesn't ask me if I want to delete any of the old backups. It simply states that it found detected old backups. I looked at the code and saw there is a flag of 1 you cna set to make it delete the old backups. I typed in ./cleanbackups 1 and it didn't do anything still. How do I pass this argument to the script?

Thanks,
Alan
 

coderoyal

Well-Known Member
Mar 8, 2005
58
0
156
Hi there,

I figured out how to pass the argument by just editing the file itself and changing the setting from 0 to 1. I also uncommented the system line it says needs to be uncommented to delete the backups.

Take care!

Alan