Re: vzdump with datestamps [message #34612 is a reply to message #34522] |
Tue, 20 January 2009 23:59  |
vader897
Messages: 2 Registered: January 2009
|
Junior Member |
|
|
Figured it out myself.
I changed
my $basename = "vzdump-${vpsid}";
to this
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst)=localtime(time);
$year += 1900;
$mon += 1;
my $basename = "vzdump-${vpsid}-$year-$mon-$mday-$hour-$min-$sec";
Maybe thats helpful to someone else. The reason why I wanted to do this was so that vzdump wouldnt overwrite files, I thought appending the date to the filenames would be more useful than just a number.
What I will do next is write a script to set as a cronjob which will do a few things.
1. dump all VE's every night
2. delete all VE's older than 2 weeks except for ones dumped on sunday.
3. delete all VE's older than 1 month except for the ones dumped on the first sunday of the month
you get the idea...
|
|
|