snapshot_backup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
snapshot_backup [2011/09/20 20:50] – [C0D3s] k2patel | snapshot_backup [2011/09/23 15:13] – [C0D3s] k2patel | ||
---|---|---|---|
Line 30: | Line 30: | ||
$awsKey = '< | $awsKey = '< | ||
$awsinstance = '< | $awsinstance = '< | ||
+ | </ | ||
+ | |||
+ | ==== bash config ==== | ||
+ | <code bash | config_bash> | ||
+ | # this file contain what need to be backup. | ||
+ | # Follow the format of value | ||
+ | # instance< | ||
+ | |||
+ | # | ||
+ | # | ||
</ | </ | ||
Line 168: | Line 178: | ||
fi | fi | ||
done | done | ||
+ | </ | ||
+ | |||
+ | |||
+ | === create snapshot === | ||
+ | |||
+ | <code perl | create_snap.pl> | ||
+ | # | ||
+ | # Created / written by k2patel@hotmail.com | ||
+ | # this script create snapshot for given volume. | ||
+ | |||
+ | use Data:: | ||
+ | use strict; | ||
+ | #use Date::Calc qw( :all ); | ||
+ | |||
+ | use lib "/ | ||
+ | use Net:: | ||
+ | |||
+ | # Configuration. | ||
+ | require " | ||
+ | |||
+ | # our $ec2; | ||
+ | our $awsId; | ||
+ | our $awsKey; | ||
+ | our $awsinstance; | ||
+ | |||
+ | my($num_args) = $#ARGV + 1; | ||
+ | if ($num_args < 2) { | ||
+ | print " | ||
+ | print "This will create Snapshot for given Volume\n"; | ||
+ | print " | ||
+ | exit 1; | ||
+ | } | ||
+ | |||
+ | ## Define Access Keys for Amazon. | ||
+ | my $ec2 = Net:: | ||
+ | AWSAccessKeyId => $awsId, | ||
+ | SecretAccessKey => $awsKey | ||
+ | ); | ||
+ | |||
+ | my @result = $ec2-> | ||
+ | VolumeId => $ARGV[0], | ||
+ | Description => $ARGV[1] | ||
+ | ); | ||
+ | |||
+ | print $result[0]-> | ||
+ | #print Dumper \@result; | ||
</ | </ |
snapshot_backup.txt · Last modified: 2020/08/10 02:35 by 127.0.0.1