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.

WHM backup

Discussion in 'General Discussion' started by unixguy79, Sep 7, 2005.

  1. unixguy79

    unixguy79 Registered

    Joined:
    Sep 7, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    A client of mine uses WHM for backing up web hosting accounts. He says that the backups do not accumulate (that is one overwrites the next). He wants the files to contain the date at least and maybe the time instead of just the account name so they don't overwrite the one from before.

    Is there any way to do this with the WHM backup mechanism and if not what alternatives do I have?

    Thanks.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It's not directly possible. However, you could write a script that rotates the cPanel full backups to store a day of the week copy too.

    Here's a script that I have written for the purpose:

    Code:
    #!/usr/bin/perl
    #
    ###############################################################################
    # Written by Jonathan Michaelson (jonathan@waytotheweb.com)
    # http://www.webumake.com
    #
    # Please feel free to use or modify this script. It would be nice to leave the
    # above intact.
    ###############################################################################
    # cPanel backup rotation script
    # v1.1 1 Feb 2004
    #
    use File::Path;
    
    my $backupdir = "/backup/cpbackup";
    my @days = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    
    # Tidy
    my $today = $days[(localtime())[6]];
    
    # Copy backup
    system ("/bin/rm -Rf $backupdir/$today");                    
    system ("/bin/cp -af $backupdir/daily $backupdir/$today");   
    exit;
    
     
  3. HelloAdam

    HelloAdam Well-Known Member

    Joined:
    Nov 6, 2005
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Howdy,

    Does this script still work?


    Thanks,
    Adam
     
Loading...

Share This Page