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.

how i can change name of backup file ?

Discussion in 'General Discussion' started by haulpd, Jun 21, 2013.

  1. haulpd

    haulpd Member

    Joined:
    May 20, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    How i can change name of backup file name with cpbackup, (Legacy Backup).
    Thank Bro.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can rename a file with the "mv" command. EX:

    Code:
    mv filename.tar.gz new-filename.tar.gz
    Could you let us know why you need to change the name of the backup file? For example, are you having trouble restoring it?

    Thank you.
     
  3. haulpd

    haulpd Member

    Joined:
    May 20, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    i want to rsync it to 1 another server. And i want to change file name will store on /backup/ when cpbackup run.

    Thank you.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There are no native features with the existing backup system that allow you to modify the default name used for backup archives. You would need to develop a custom post stage System::Backup hook that modifies the name of the backup archives.

    Thank you.
     
  5. haulpd

    haulpd Member

    Joined:
    May 20, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    i,ve change name to user-domain_yyyymmdd.tar.gz but i can not restore with Cpanel, i'm forced change it to user.tar.gz. I see in /script/restorepkg

    if ( $file =~ m/^cpmove-(\S+)\.tar(?:\.gz$|$)/ ) {
    print "Using cpmove archive\n";
    $user = $1;
    }
    elsif ( $file =~ /^backup-\d+\.\d+\.\d+_\d+\-\d+\-\d+_(\S+)\.tar(?:\.gz$|$)/ ) {
    print "Using backup archive\n";
    $user = $1;
    }
    elsif ( $file =~ m/^(\S+)\.tar(?:\.gz$|$)/ ) {
    print "Using username archive\n";
    $user = $1;

    and it call whostmgr5 to restore, How i can defined file name backup file can restore. ? Thanks.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The backups must be named in one of the following formats in order to be restored:

    Code:
    cpmove-{USER}
    cpmove-{USER}.tar
    cpmove-{USER}.tar.gz
    USER.tar
    USER.tar.gz
    backup-{BACKUP-DATE_TIME}_{USER}.tar
    backup-{BACKUP-DATE_TIME}_{USER}.tar.gz
    Thank you.
     
Loading...

Share This Page