unixguy79

Registered
Sep 7, 2005
2
0
151
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.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
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 ([email protected])
# 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;