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.

delete deleted account backups

Discussion in 'General Discussion' started by wills, Nov 8, 2003.

  1. wills

    wills Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    202
    Likes Received:
    1
    Trophy Points:
    18
    Is there a script that will cleanup backup files of deleted accounts? Its a pain, when someone cancels an account, the backup files do not get removed...
     
  2. darkelder

    darkelder Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    I notice same issue here. I did not found yet a script, but I'll do.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
  4. darkelder

    darkelder Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Thank you chirpy, this advanced tool fix my problems :)

    A recommendation: do not use it w/o extra care!
     
  5. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    I wish this was included with the cpanel backup feature.
     
  6. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    What does this do? Does it just simply empty out the backup folders and run the backup script or is it more intelligent!?

    How would you run it?

    Ta

    Simon
     
  7. Danny_T

    Danny_T Well-Known Member

    Joined:
    Jul 19, 2005
    Messages:
    181
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Netherlands
    It is secured. It wont delete by default. You have to modify the script.

    Anyway, if i run this script i get :

    ./cleanbackups
    Reading Backup Config...Complete
    Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ


    So i guess it wont work?

    Danny
     
  8. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Hi - can someone please explain how we should run this?
     
  9. SonServers

    SonServers Well-Known Member

    Joined:
    Oct 24, 2001
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    I do my own daily backup rotation which also by default will clean out the old files.

    I started by creating two more directories in the backup directory so I have:

    daily
    daily1
    daily2

    Then, I wrote a simple script that runs via cron just before the daily backup:

    rm -Rf /backup/cpbackup/daily2
    mv /backup/cpbackup/daily1 /backup/cpbackup/daily2
    mv /backup/cpbackup/daily /backup/cpbackup/daily1

    When the script runs, it deletes daily2, renames daily1 as daily2, then renames daily as daily1. Shortly after, the backup runs and creates a new daily directory with today's backups. So, when the backup is done, I again have three days of backups:
    daily (yesterday)
    daily1 (day before)
    daily2 (two days before)

    (Once a week, I also FTP the daily backup to a remote system)

    The backup script will create a new daily directory if its not there when it runs so a new one is created every day. Thus, the deleted accounts are not saved. Also, when a customer needs a site restored, we have the last three days to chose from rather than just yesterday.

    I know this is simple and it requires sufficient backup space for multiple copies of backups, but maybe the idea will help.
     
  10. cluxa

    cluxa Registered

    Joined:
    Jun 10, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    This code should be fixed in the script to avoid this message, though it should not bother really:
    until (`ps -ax` !~ m/cpbackup/) {
    print "Detected cpbackup process...Sleeping for 60 Seconds\n";
    sleep(60);
    };

    change `ps -ax` to `ps ax`
     
  11. Convergence

    Convergence Member

    Joined:
    Oct 8, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
  12. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Chmod the file 700 (root only run).

    Ensure on the first run that $delete_old=0

    run the script
    ./cleanbackups

    verify the output is correct, if it is correct change the $delete_old=1

    rerun script
     
Loading...

Share This Page