Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Linux VPS Support

Notices

Reply
 
Thread Tools
  #1  
Old 12-13-2010, 09:56 AM
pmatra's Avatar
pmatra pmatra is offline
Baby Croc
 
Join Date: May 2008
Location: NY
Posts: 65
Question WHM Auto Backup- file name remains the same

Hi folks,

I have a VPS and have configured WHM to do an automatic backup of my primary account daily and sending it to my FTP Server. Everything works fine and it does the backups but the are called by my accounts 'username'.tar

That is ok, but when each backup is sent to my server it overwrites the previous day's backup because each one is generated with the same name. Is a way to change the name so it automatically adds the data of the backup to the name? Something that you would see when you do a cPanel Full account backup.


pete
__________________
Peter Matra
nyhostingsolutions.com

I love HG
Reply With Quote
  #2  
Old 12-14-2010, 11:49 PM
weserver weserver is offline
Baby Croc
 
Join Date: Aug 2009
Posts: 96
Default Re: WHM Auto Backup- file name remains the same

+1 on that question. I really wondered about that myself. The idea though, is that daily IS daily, and you should perhaps add weekly and monthly backup's as well in the cpanel konfiguration settings.

I was thinking more in the direction of: maybe there's a way to have cpanel create the "daily", "weekly", "monthly" folders with a date added to the folder name ?
Reply With Quote
  #3  
Old 12-15-2010, 05:43 AM
quietFinn's Avatar
quietFinn quietFinn is online now
Veteran Croc
 
Join Date: Feb 2005
Posts: 3,558
Default Re: WHM Auto Backup- file name remains the same

Here is a script from Configserver.com:

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.2
#
# usage: /usr/bin/dowbackup.pl [Monday,Wednesday,Friday]

my %bconf;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
my @days = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
my $today = $days[$wday];
$year = 2000 + ($year % 100);
$mon++;
$mon = sprintf("%02d",$mon);
$mday = sprintf("%02d",$mday);
my $date = "$year$mon$mday";
if ($ARGV[0] ne "") {
        foreach my $entry (split(/\,/,$ARGV[0])) {
                $doday{lc $entry} = 1;
        }
}

if (($ARGV[0] ne "") and ($doday{lc $today} != 1)) {
        print "Backup Rotate: Doesn't run on $today\n";
        exit;
}

open (IN, "</etc/cpbackup.conf");
my @lines = <IN>;
close (IN);
chomp @lines;
you can call that from:
/scripts/postcpbackup
__________________
quietFinn - netFinn Finland
"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." - Dr. Seuss
Reply With Quote
  #4  
Old 12-16-2010, 11:59 AM
pmatra's Avatar
pmatra pmatra is offline
Baby Croc
 
Join Date: May 2008
Location: NY
Posts: 65
Default Re: WHM Auto Backup- file name remains the same

Ok cool script. I have no clue how the hell to use it...LOL I will figure it out though. I assume there are instructions on configserver.com

att: weserver- that sounds like a good idea if you your server is full of files. Makes a lot of sense.

Pete
__________________
Peter Matra
nyhostingsolutions.com

I love HG
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Backup Database mbuhmann Shared Hosting Support 5 01-28-2010 12:29 PM
Daily auto backup of database KC TAN Shared Hosting Support 4 02-18-2007 06:30 PM

All times are GMT -5. The time now is 11:13 AM.