added version checking command to sanoid and syncoid
This commit is contained in:
parent
b257eac788
commit
33d154d04b
5
sanoid
5
sanoid
|
@ -4,6 +4,8 @@
|
||||||
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
|
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
|
||||||
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
|
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
|
||||||
|
|
||||||
|
my $version = '1.0.8';
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Config::IniFiles; # read samba-style conf file
|
use Config::IniFiles; # read samba-style conf file
|
||||||
use File::Path; # for rmtree command in use_prune
|
use File::Path; # for rmtree command in use_prune
|
||||||
|
@ -38,6 +40,9 @@ if ($ARGV[0] eq '--verbose') {
|
||||||
monitor_health(@params);
|
monitor_health(@params);
|
||||||
} elsif ($ARGV[0] eq '--force-update') {
|
} elsif ($ARGV[0] eq '--force-update') {
|
||||||
my %snaps = getsnaps( \%config, $cacheTTL, 1 );
|
my %snaps = getsnaps( \%config, $cacheTTL, 1 );
|
||||||
|
} elsif ($ARGV[0] eq '--version') {
|
||||||
|
print "Sanoid version: $version\n";
|
||||||
|
exit 0;
|
||||||
} elsif ($ARGV[0] eq '--cron' || 1) {
|
} elsif ($ARGV[0] eq '--cron' || 1) {
|
||||||
take_snapshots (@params);
|
take_snapshots (@params);
|
||||||
prune_snapshots (@params);
|
prune_snapshots (@params);
|
||||||
|
|
9
syncoid
9
syncoid
|
@ -4,6 +4,8 @@
|
||||||
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
|
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
|
||||||
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
|
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
|
||||||
|
|
||||||
|
my $version = '1.0.8';
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Time::Local;
|
use Time::Local;
|
||||||
|
@ -11,6 +13,11 @@ use Sys::Hostname;
|
||||||
|
|
||||||
my %args = getargs(@ARGV);
|
my %args = getargs(@ARGV);
|
||||||
|
|
||||||
|
if ($args{'version'}) {
|
||||||
|
print "Syncoid version: $version\n";
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
my $rawsourcefs = $args{'source'};
|
my $rawsourcefs = $args{'source'};
|
||||||
my $rawtargetfs = $args{'target'};
|
my $rawtargetfs = $args{'target'};
|
||||||
my $debug = $args{'debug'};
|
my $debug = $args{'debug'};
|
||||||
|
@ -162,7 +169,7 @@ sub getargs {
|
||||||
my @args = @_;
|
my @args = @_;
|
||||||
my %args;
|
my %args;
|
||||||
|
|
||||||
my $novalueargs = ",debug,nocommandchecks,";
|
my $novalueargs = ",debug,nocommandchecks,version,";
|
||||||
|
|
||||||
while (my $arg = shift(@args)) {
|
while (my $arg = shift(@args)) {
|
||||||
if ($arg =~ /^--/) {
|
if ($arg =~ /^--/) {
|
||||||
|
|
Loading…
Reference in New Issue