diff --git a/sanoid b/sanoid index 1ff1f2f..a2e9dc9 100755 --- a/sanoid +++ b/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 # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE. +my $version = '1.0.8'; + use strict; use Config::IniFiles; # read samba-style conf file use File::Path; # for rmtree command in use_prune @@ -38,6 +40,9 @@ if ($ARGV[0] eq '--verbose') { monitor_health(@params); } elsif ($ARGV[0] eq '--force-update') { my %snaps = getsnaps( \%config, $cacheTTL, 1 ); +} elsif ($ARGV[0] eq '--version') { + print "Sanoid version: $version\n"; + exit 0; } elsif ($ARGV[0] eq '--cron' || 1) { take_snapshots (@params); prune_snapshots (@params); diff --git a/syncoid b/syncoid index 00d5e71..1ec11b3 100755 --- a/syncoid +++ b/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 # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE. +my $version = '1.0.8'; + use strict; use Data::Dumper; use Time::Local; @@ -11,6 +13,11 @@ use Sys::Hostname; my %args = getargs(@ARGV); +if ($args{'version'}) { + print "Syncoid version: $version\n"; + exit 0; +} + my $rawsourcefs = $args{'source'}; my $rawtargetfs = $args{'target'}; my $debug = $args{'debug'}; @@ -162,7 +169,7 @@ sub getargs { my @args = @_; my %args; - my $novalueargs = ",debug,nocommandchecks,"; + my $novalueargs = ",debug,nocommandchecks,version,"; while (my $arg = shift(@args)) { if ($arg =~ /^--/) {