Subversion Repositories sysadmin_scripts

Rev

Rev 97 | Rev 99 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 97 Rev 98
Line 1... Line 1...
1
#! /usr/bin/env perl
1
#! /usr/bin/env perl
2
 
2
 
-
 
3
#    snapShot: Manage ZFS snapshots
-
 
4
#    see http://wiki.linuxservertech.com for additional information
-
 
5
#    Copyright (C) 2022  R. W. Rodolico
-
 
6
#
-
 
7
#    version 1.0, 20220423
-
 
8
#       Initial Release
-
 
9
#
-
 
10
#
-
 
11
#    This program is free software: you can redistribute it and/or modify
-
 
12
#    it under the terms of the GNU General Public License as published by
-
 
13
#    the Free Software Foundation, either version 3 of the License, or
-
 
14
#    (at your option) any later version.
-
 
15
#
-
 
16
#    This program is distributed in the hope that it will be useful,
-
 
17
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-
 
18
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-
 
19
#    GNU General Public License for more details.
-
 
20
#
-
 
21
#    You should have received a copy of the GNU General Public License
-
 
22
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
 
23
#
-
 
24
# Warning, this script requires YAML::Tiny and Hash::Merge Perl Modules to be installed
-
 
25
# Under Debian:  apt install libyaml-tiny-perl libhash-merge-simple-perl
-
 
26
# Under FreeBSD: cpan -i Hash::Merge::Simple YAML::Tiny
-
 
27
 
-
 
28
 
3
use strict;
29
use strict;
4
use warnings;
30
use warnings;
5
 
31
 
6
use Data::Dumper;
32
use Data::Dumper;
7
use Time::Local;
33
use Time::Local;
8
use POSIX qw(strftime);
34
use POSIX qw(strftime);
9
use YAML::Tiny; # apt-get libyaml-tiny-perl under debian, BSD Systems: cpan -i YAML::Tiny
35
use YAML::Tiny; # apt-get libyaml-tiny-perl under debian, BSD Systems: cpan -i YAML::Tiny
10
use Hash::Merge::Simple qw/ merge clone_merge /; # libhash-merge-simple-perl
36
use Hash::Merge::Simple qw/ merge clone_merge /; # apt install libhash-merge-simple-perl or cpan -i Hash::Merge::Simple
11
 
37
 
12
 
38
 
13
# globals
39
# globals
14
my $CONFIG_FILE_NAME = 'snapShot.yaml';
40
my $CONFIG_FILE_NAME = 'snapShot.yaml';
15
 
41
 
16
 
-
 
17
# This will be read in from snapShot.yaml
42
# This will be read in from snapShot.yaml
18
my $config;
43
my $config;
19
 
44
 
20
#
45
#
21
# find where the script is actually located as cfg should be there
46
# find where the script is actually located as cfg should be there