New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
fcm-backup-svn-repos in vendors/fcm/current/examples/sbin – NEMO

source: vendors/fcm/current/examples/sbin/fcm-backup-svn-repos @ 1977

Last change on this file since 1977 was 1977, checked in by flavoni, 14 years ago

importing fcm vendor

File size: 2.7 KB
Line 
1#!/usr/bin/perl
2# ------------------------------------------------------------------------------
3# (C) Crown copyright Met Office. All rights reserved.
4# For further details please refer to the file COPYRIGHT.txt
5# which you should have received as part of this distribution.
6# ------------------------------------------------------------------------------
7
8use strict;
9use warnings;
10
11use FindBin;
12use lib "$FindBin::Bin/../lib";
13use FCM::Admin::System qw{
14    backup_svn_repository
15    filter_projects
16    get_projects_from_svn_live
17};
18use FCM::Admin::Util qw{option2config};
19use Getopt::Long qw{GetOptions};
20use Pod::Usage qw{pod2usage};
21
22main();
23
24sub main {
25    my %option;
26    my $result = GetOptions(
27        \%option,
28        q{help|usage|h},
29        q{no-housekeep-dumps},
30        q{no-verify-integrity},
31        q{svn-backup-dir=s},
32        q{svn-dump-dir=s},
33        q{svn-live-dir=s},
34        q{svn-project-suffix=s},
35    );
36    if (!$result) {
37        pod2usage(1);
38    }
39    if (exists($option{help})) {
40        pod2usage(q{-verbose} => 1);
41    }
42    option2config(\%option);
43    my @projects = filter_projects([get_projects_from_svn_live()], \@ARGV);
44    for my $project (@projects) {
45        backup_svn_repository(
46            $project,
47            !$option{q{no-housekeep-dumps}},
48            !$option{q{no-verify-integrity}},
49        );
50    }
51}
52
53__END__
54
55=head1 NAME
56
57fcm-backup-svn-repos
58
59=head1 SYNOPSIS
60
61    fcm-backup-svn-repos [OPTIONS] [PROJECT ...]
62
63=head1 OPTIONS
64
65=over 4
66
67=item --help, -h, --usage
68
69Prints help and exits.
70
71=item --no-housekeep-dumps
72
73If this option is specified, the program will not housekeep the backup revision
74dumps of each repository.
75
76=item --no-verify-integrity
77
78If this option is specified, the program will not verify the integrity of a
79repository before running the backup.
80
81=item --svn-backup-dir=DIR
82
83Specifies the root location of the backup directory. See
84L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
85
86=item --svn-dump-dir=DIR
87
88Specifies the root location of the directory where revision dumps are kept. See
89L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
90
91=item --svn-live-dir=DIR
92
93Specifies the root location of the live directory. See
94L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
95
96=item --svn-project-suffix=NAME
97
98Specifies the suffix added to the project name. The default is "_svn".
99
100=back
101
102=head1 ARGUMENTS
103
104=over 4
105
106=item PROJECT
107
108Specifies one or more project to back up. If no project is specified, the
109program searches the live directory for projects to back up.
110
111=back
112
113=head1 DESCRIPTION
114
115This program archives Subversion repositories in the live directory to the
116backup directory.
117
118=head1 COPYRIGHT
119
120E<169> Crown copyright Met Office. All rights reserved.
121
122=cut
Note: See TracBrowser for help on using the repository browser.