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:51] – [C0D3s] k2patel | snapshot_backup [2011/09/23 15:14] – [C0D3s] k2patel | ||
---|---|---|---|
Line 20: | Line 20: | ||
* delete_snap.pl | * delete_snap.pl | ||
- | ==== C0D3s ==== | + | ===== C0D3s ===== |
- | === config === | + | ==== config |
<code bash | config > | <code bash | config > | ||
Line 32: | Line 32: | ||
</ | </ | ||
- | === db.pl === | + | ==== bash config ==== |
+ | <code bash | config_bash> | ||
+ | # this file contain what need to be backup. | ||
+ | # Follow the format of value | ||
+ | # instance< | ||
+ | |||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | ==== db.pl ==== | ||
<code perl | db.pl > | <code perl | db.pl > | ||
Line 99: | Line 109: | ||
</ | </ | ||
- | === backup.sh === | + | ==== backup.sh |
<code bash | backup.sh> | <code bash | backup.sh> | ||
Line 171: | Line 181: | ||
- | Coming....... more | + | ==== 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