how i can change name of backup file ?

haulpd

Active Member
May 20, 2011
31
1
58
How i can change name of backup file name with cpbackup, (Legacy Backup).
Thank Bro.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.
 

haulpd

Active Member
May 20, 2011
31
1
58
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.
 

haulpd

Active Member
May 20, 2011
31
1
58
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.