The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Backups - terminated accounts

Discussion in 'General Discussion' started by eglwolf, Mar 10, 2005.

  1. eglwolf

    eglwolf Well-Known Member

    Joined:
    Jan 1, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    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?
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
  3. Host4u2

    Host4u2 Well-Known Member

    Joined:
    Mar 24, 2002
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  4. coderoyal

    coderoyal Well-Known Member

    Joined:
    Mar 8, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  5. coderoyal

    coderoyal Well-Known Member

    Joined:
    Mar 8, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    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
     
Loading...

Share This Page