mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-12 10:04:14 +02:00
Add repo-create, repo-get, repo-put, and repo-rm commands.
These commands are generally useful but more importantly they allow removing LibC by providing the Perl integration tests an alternate way to work with repository storage. All the commands are currently internal only and should not be used on production repositories.
This commit is contained in:
parent
948835fb84
commit
d3c83453de
@ -89,8 +89,16 @@ use constant CFGCMD_HELP => 'help';
|
||||
push @EXPORT, qw(CFGCMD_HELP);
|
||||
use constant CFGCMD_INFO => 'info';
|
||||
push @EXPORT, qw(CFGCMD_INFO);
|
||||
use constant CFGCMD_REPO_CREATE => 'repo-create';
|
||||
push @EXPORT, qw(CFGCMD_REPO_CREATE);
|
||||
use constant CFGCMD_REPO_GET => 'repo-get';
|
||||
push @EXPORT, qw(CFGCMD_REPO_GET);
|
||||
use constant CFGCMD_REPO_LS => 'repo-ls';
|
||||
push @EXPORT, qw(CFGCMD_REPO_LS);
|
||||
use constant CFGCMD_REPO_PUT => 'repo-put';
|
||||
push @EXPORT, qw(CFGCMD_REPO_PUT);
|
||||
use constant CFGCMD_REPO_RM => 'repo-rm';
|
||||
push @EXPORT, qw(CFGCMD_REPO_RM);
|
||||
use constant CFGCMD_RESTORE => 'restore';
|
||||
push @EXPORT, qw(CFGCMD_RESTORE);
|
||||
use constant CFGCMD_STANZA_CREATE => 'stanza-create';
|
||||
@ -152,8 +160,14 @@ use constant CFGOPT_REMOTE_TYPE => 'remote-t
|
||||
|
||||
# Command-line only storage options
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
use constant CFGOPT_CIPHER_PASS => 'cipher-pass';
|
||||
push @EXPORT, qw(CFGOPT_CIPHER_PASS);
|
||||
use constant CFGOPT_FILTER => 'filter';
|
||||
push @EXPORT, qw(CFGOPT_FILTER);
|
||||
use constant CFGOPT_IGNORE_MISSING => 'ignore-missing';
|
||||
push @EXPORT, qw(CFGOPT_IGNORE_MISSING);
|
||||
use constant CFGOPT_RAW => 'raw';
|
||||
push @EXPORT, qw(CFGOPT_RAW);
|
||||
use constant CFGOPT_RECURSE => 'recurse';
|
||||
push @EXPORT, qw(CFGOPT_RECURSE);
|
||||
use constant CFGOPT_SORT => 'sort';
|
||||
@ -621,6 +635,20 @@ my $rhCommandDefine =
|
||||
&CFGDEF_LOG_LEVEL_DEFAULT => DEBUG,
|
||||
},
|
||||
|
||||
&CFGCMD_REPO_CREATE =>
|
||||
{
|
||||
&CFGDEF_INTERNAL => true,
|
||||
&CFGDEF_LOG_FILE => false,
|
||||
},
|
||||
|
||||
&CFGCMD_REPO_GET =>
|
||||
{
|
||||
&CFGDEF_INTERNAL => true,
|
||||
&CFGDEF_LOG_FILE => false,
|
||||
&CFGDEF_LOG_LEVEL_DEFAULT => DEBUG,
|
||||
&CFGDEF_PARAMETER_ALLOWED => true,
|
||||
},
|
||||
|
||||
&CFGCMD_REPO_LS =>
|
||||
{
|
||||
&CFGDEF_INTERNAL => true,
|
||||
@ -629,6 +657,22 @@ my $rhCommandDefine =
|
||||
&CFGDEF_PARAMETER_ALLOWED => true,
|
||||
},
|
||||
|
||||
&CFGCMD_REPO_PUT =>
|
||||
{
|
||||
&CFGDEF_INTERNAL => true,
|
||||
&CFGDEF_LOG_FILE => false,
|
||||
&CFGDEF_LOG_LEVEL_DEFAULT => DEBUG,
|
||||
&CFGDEF_PARAMETER_ALLOWED => true,
|
||||
},
|
||||
|
||||
&CFGCMD_REPO_RM =>
|
||||
{
|
||||
&CFGDEF_INTERNAL => true,
|
||||
&CFGDEF_LOG_FILE => false,
|
||||
&CFGDEF_LOG_LEVEL_DEFAULT => DEBUG,
|
||||
&CFGDEF_PARAMETER_ALLOWED => true,
|
||||
},
|
||||
|
||||
&CFGCMD_RESTORE =>
|
||||
{
|
||||
},
|
||||
@ -686,7 +730,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -797,6 +845,26 @@ my %hConfigDefine =
|
||||
{
|
||||
&CFGDEF_REQUIRED => false
|
||||
},
|
||||
&CFGCMD_REPO_CREATE =>
|
||||
{
|
||||
&CFGDEF_REQUIRED => false
|
||||
},
|
||||
&CFGCMD_REPO_GET =>
|
||||
{
|
||||
&CFGDEF_REQUIRED => false
|
||||
},
|
||||
&CFGCMD_REPO_LS =>
|
||||
{
|
||||
&CFGDEF_REQUIRED => false
|
||||
},
|
||||
&CFGCMD_REPO_PUT =>
|
||||
{
|
||||
&CFGDEF_REQUIRED => false
|
||||
},
|
||||
&CFGCMD_REPO_RM =>
|
||||
{
|
||||
&CFGDEF_REQUIRED => false
|
||||
},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1000,7 +1068,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_BACKUP => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1025,7 +1097,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_BACKUP => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1035,6 +1111,18 @@ my %hConfigDefine =
|
||||
|
||||
# Command-line only storage options
|
||||
#-------------------------------------------------------------------------------------------------------------------------------
|
||||
&CFGOPT_CIPHER_PASS =>
|
||||
{
|
||||
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
||||
&CFGDEF_INTERNAL => true,
|
||||
&CFGDEF_REQUIRED => false,
|
||||
&CFGDEF_COMMAND =>
|
||||
{
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
}
|
||||
},
|
||||
|
||||
&CFGOPT_FILTER =>
|
||||
{
|
||||
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
||||
@ -1045,6 +1133,27 @@ my %hConfigDefine =
|
||||
}
|
||||
},
|
||||
|
||||
&CFGOPT_IGNORE_MISSING =>
|
||||
{
|
||||
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
||||
&CFGDEF_DEFAULT => false,
|
||||
&CFGDEF_COMMAND =>
|
||||
{
|
||||
&CFGCMD_REPO_GET => {},
|
||||
}
|
||||
},
|
||||
|
||||
&CFGOPT_RAW =>
|
||||
{
|
||||
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
||||
&CFGDEF_DEFAULT => false,
|
||||
&CFGDEF_COMMAND =>
|
||||
{
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
}
|
||||
},
|
||||
|
||||
&CFGOPT_RECURSE =>
|
||||
{
|
||||
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
||||
@ -1052,6 +1161,7 @@ my %hConfigDefine =
|
||||
&CFGDEF_COMMAND =>
|
||||
{
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
}
|
||||
},
|
||||
|
||||
@ -1115,7 +1225,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1135,7 +1249,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_ARCHIVE_PUSH => {},
|
||||
&CFGCMD_BACKUP => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
&CFGCMD_STANZA_UPGRADE => {},
|
||||
@ -1202,7 +1320,9 @@ my %hConfigDefine =
|
||||
&CFGCMD_BACKUP => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1222,7 +1342,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_BACKUP => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1245,7 +1369,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1289,7 +1417,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1312,7 +1444,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_BACKUP => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1403,7 +1539,11 @@ my %hConfigDefine =
|
||||
&CFGDEF_INTERNAL => true,
|
||||
},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE =>
|
||||
{
|
||||
@ -1439,7 +1579,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_ARCHIVE_PUSH => {},
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_START => {},
|
||||
&CFGCMD_STOP => {},
|
||||
@ -1677,7 +1821,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1805,7 +1953,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1881,7 +2033,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1905,7 +2061,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1929,7 +2089,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
@ -1952,7 +2116,11 @@ my %hConfigDefine =
|
||||
&CFGCMD_CHECK => {},
|
||||
&CFGCMD_EXPIRE => {},
|
||||
&CFGCMD_INFO => {},
|
||||
&CFGCMD_REPO_CREATE => {},
|
||||
&CFGCMD_REPO_GET => {},
|
||||
&CFGCMD_REPO_LS => {},
|
||||
&CFGCMD_REPO_PUT => {},
|
||||
&CFGCMD_REPO_RM => {},
|
||||
&CFGCMD_RESTORE => {},
|
||||
&CFGCMD_STANZA_CREATE => {},
|
||||
&CFGCMD_STANZA_DELETE => {},
|
||||
|
@ -894,6 +894,17 @@
|
||||
|
||||
<operation-general title="General Options">
|
||||
<option-list>
|
||||
<!-- OPERATION - GENERAL - CIPHER-PASS OPTION -->
|
||||
<option id="cipher-pass" name="Ad Hoc Cipher Passphrase">
|
||||
<summary>Cipher passphrase for current command.</summary>
|
||||
|
||||
<text>Specify an ad hoc cipher passphrase for the current command.
|
||||
|
||||
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
|
||||
|
||||
<example>zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO</example>
|
||||
</option>
|
||||
|
||||
<!-- OPERATION - GENERAL - CONFIG OPTION -->
|
||||
<option id="config" name="Config">
|
||||
<summary><backrest/> configuration file.</summary>
|
||||
@ -923,6 +934,15 @@
|
||||
<example>/conf/pgbackrest</example>
|
||||
</option>
|
||||
|
||||
<!-- OPERATION - GENERAL - RAW -->
|
||||
<option id="raw" name="Raw Data">
|
||||
<summary>Do not transform data.</summary>
|
||||
|
||||
<text>Do not transform (i.e, encrypt, decompress, etc.) data for the current command.</text>
|
||||
|
||||
<example>y</example>
|
||||
</option>
|
||||
|
||||
<!-- OPERATION - GENERAL - STANZA OPTION -->
|
||||
<option id="stanza" name="Stanza">
|
||||
<summary>Defines the stanza.</summary>
|
||||
@ -1057,6 +1077,53 @@
|
||||
</command-example-list>
|
||||
</command>
|
||||
|
||||
<!-- OPERATION - REPO-CREATE COMMAND -->
|
||||
<command id="repo-create" name="Create Repository">
|
||||
<summary>Create the repository.</summary>
|
||||
|
||||
<text>Creates the bucket if <setting>repo-type=s3</setting>.
|
||||
|
||||
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
|
||||
|
||||
<command-example-list>
|
||||
<command-example title="Create repository">
|
||||
<text><code-block title="">
|
||||
{[backrest-exe]} repo-create
|
||||
</code-block>
|
||||
|
||||
Create the repository.</text>
|
||||
</command-example>
|
||||
</command-example-list>
|
||||
</command>
|
||||
|
||||
<!-- OPERATION - REPO-GET COMMAND -->
|
||||
<command id="repo-get" name="Repository Get File">
|
||||
<summary>Get a file from the repository.</summary>
|
||||
|
||||
<text>Similar to the unix <cmd>cat</cmd> command but options are different.</text>
|
||||
|
||||
<option-list>
|
||||
<!-- OPERATION - REPO-GET COMMAND - IGNORE-MISSING OPTION -->
|
||||
<option id="ignore-missing" name="Ignore Missing">
|
||||
<summary>Ignore missing source file.</summary>
|
||||
|
||||
<text>Exit with 1 if the source file is missing but don't throw an error.</text>
|
||||
|
||||
<example>y</example>
|
||||
</option>
|
||||
</option-list>
|
||||
|
||||
<command-example-list>
|
||||
<command-example title="Get a file from the repository">
|
||||
<text><code-block title="">
|
||||
{[backrest-exe]} repo-get backup/demo/file.txt
|
||||
</code-block>
|
||||
|
||||
Get a file from the demo stanza.</text>
|
||||
</command-example>
|
||||
</command-example-list>
|
||||
</command>
|
||||
|
||||
<!-- OPERATION - REPO-LS COMMAND -->
|
||||
<command id="repo-ls" name="Repository List Paths/Files">
|
||||
<summary>List paths/files in the repository.</summary>
|
||||
@ -1121,6 +1188,55 @@
|
||||
</command-example-list>
|
||||
</command>
|
||||
|
||||
<!-- OPERATION - REPO-PUT COMMAND -->
|
||||
<command id="repo-put" name="Repository Put File">
|
||||
<summary>Put a file in the repository.</summary>
|
||||
|
||||
<text>Similar to the unix <cmd>tee</cmd> command but options and behavior are different.
|
||||
|
||||
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
|
||||
|
||||
<command-example-list>
|
||||
<command-example title="Put a file in the repository">
|
||||
<text><code-block title="">
|
||||
cat file.txt {[backrest-exe]} repo-put backup/demo/file.txt
|
||||
</code-block>
|
||||
|
||||
Put a file in the demo stanza.</text>
|
||||
</command-example>
|
||||
</command-example-list>
|
||||
</command>
|
||||
|
||||
<!-- OPERATION - RM COMMAND -->
|
||||
<command id="repo-rm" name="Repository Remove Paths/Files">
|
||||
<summary>Remove paths/files in the repository.</summary>
|
||||
|
||||
<text>Similar to the unix <cmd>rm</cmd> command but options are different.
|
||||
|
||||
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
|
||||
|
||||
<option-list>
|
||||
<!-- OPERATION - RM COMMAND - RECURSE OPTION -->
|
||||
<option id="recurse" name="Recurse Subpaths">
|
||||
<summary>Remove all sub file/paths.</summary>
|
||||
|
||||
<text>All subpaths and their files will be removed.</text>
|
||||
|
||||
<example>y</example>
|
||||
</option>
|
||||
</option-list>
|
||||
|
||||
<command-example-list>
|
||||
<command-example title="Remove backup">
|
||||
<text><code-block title="">
|
||||
{[backrest-exe]} rm --recurse backup/demo/20190718-155825F
|
||||
</code-block>
|
||||
|
||||
Remove 20190718-155825F backup in the demo stanza.</text>
|
||||
</command-example>
|
||||
</command-example-list>
|
||||
</command>
|
||||
|
||||
<!-- OPERATION - RESTORE COMMAND -->
|
||||
<command id="restore" name="Restore">
|
||||
<summary>Restore a database cluster.</summary>
|
||||
|
@ -245,9 +245,6 @@
|
||||
chmod 600 /root/.ssh/*
|
||||
</variable>
|
||||
|
||||
<variable key="minio-client-install">wget https://dl.min.io/client/mc/release/linux-amd64/mc -qO /usr/bin/mc && \
|
||||
chmod 755 /usr/bin/mc</variable>
|
||||
|
||||
<variable key="copy-ca-cert">COPY {[fake-cert-path-relative]}/ca.crt {[ca-cert-path]}/pgbackrest-ca.crt</variable>
|
||||
</variable-list>
|
||||
|
||||
@ -293,8 +290,6 @@
|
||||
update-locale LANG=en_US.UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
|
||||
RUN {[minio-client-install]}
|
||||
|
||||
ENTRYPOINT service ssh restart && bash
|
||||
</host-define>
|
||||
|
||||
@ -324,8 +319,6 @@
|
||||
RUN adduser -n {[host-user]} && \
|
||||
echo '{[host-user]} ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/{[host-user]}
|
||||
|
||||
RUN {[minio-client-install]}
|
||||
|
||||
ENTRYPOINT /usr/sbin/sshd -D
|
||||
</host-define>
|
||||
|
||||
@ -375,8 +368,6 @@
|
||||
ln -s /usr/lib/systemd/system/systemd-user-sessions.service \
|
||||
/etc/systemd/system/default.target.wants/systemd-user-sessions.service
|
||||
|
||||
RUN {[minio-client-install]}
|
||||
|
||||
CMD ["/usr/sbin/init"]
|
||||
</host-define>
|
||||
|
||||
@ -592,23 +583,6 @@
|
||||
<block-define id="s3-setup">
|
||||
<p><backrest/> supports locating repositories in <proper>S3-compatible</proper> object stores. The bucket used to store the repository must be created in advance &mdash; <backrest/> will not do it automatically. The repository can be located in the bucket root (<path>/</path>) but it's usually best to place it in a subpath so object store logs or other data can also be stored in the bucket without conflicts.</p>
|
||||
|
||||
<execute-list if="'{[s3-local]}' eq 'y'" host="{[s3-setup-host]}" show="n">
|
||||
<title>Create the bucket</title>
|
||||
|
||||
<!-- Set host entries to redirect AWS to local s3 server -->
|
||||
<execute user="root" user-force="y" show="n">
|
||||
<exe-cmd>echo "{[host-s3-ip]} {[s3-bucket]}.{[s3-endpoint]} {[s3-endpoint]}" | tee -a /etc/hosts</exe-cmd>
|
||||
</execute>
|
||||
|
||||
<execute show='n'>
|
||||
<exe-cmd>mc config host add demo https://{[host-s3-ip]} {[s3-key]} {[s3-key-secret]} --insecure</exe-cmd>
|
||||
</execute>
|
||||
|
||||
<execute if="'{[s3-setup-create-bucket]}' eq 'y'" show='n'>
|
||||
<exe-cmd>mc mb demo/{[s3-bucket]} --insecure</exe-cmd>
|
||||
</execute>
|
||||
</execute-list>
|
||||
|
||||
<backrest-config host="{[s3-setup-host]}" file="{[backrest-config-demo]}" owner="{[s3-setup-config-owner]}">
|
||||
<title>Configure <proper>S3</proper></title>
|
||||
|
||||
@ -623,6 +597,19 @@
|
||||
<backrest-config-option section="global" key="process-max">4</backrest-config-option>
|
||||
</backrest-config>
|
||||
|
||||
<execute-list if="'{[s3-local]}' eq 'y'" host="{[s3-setup-host]}" show="n">
|
||||
<title>Create the bucket</title>
|
||||
|
||||
<!-- Set host entries to redirect AWS to local s3 server -->
|
||||
<execute user="root" user-force="y" show="n">
|
||||
<exe-cmd>echo "{[host-s3-ip]} {[s3-bucket]}.{[s3-endpoint]} {[s3-endpoint]}" | tee -a /etc/hosts</exe-cmd>
|
||||
</execute>
|
||||
|
||||
<execute user="{[s3-setup-user]}" if="'{[s3-setup-create-bucket]}' eq 'y'" show='n'>
|
||||
<exe-cmd>{[project-exe]} repo-create</exe-cmd>
|
||||
</execute>
|
||||
</execute-list>
|
||||
|
||||
<admonition type="note">The region and endpoint will need to be configured to where the bucket is located. The values given here are for the <id>{[s3-region]}</id> region.</admonition>
|
||||
</block-define>
|
||||
|
||||
@ -1036,6 +1023,7 @@
|
||||
|
||||
<block id="s3-setup">
|
||||
<block-variable-replace key="s3-setup-host">{[host-pg1]}</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-user">postgres</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-config-owner">postgres:postgres</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-create-bucket">y</block-variable-replace>
|
||||
</block>
|
||||
@ -2066,6 +2054,7 @@
|
||||
|
||||
<block id="s3-setup">
|
||||
<block-variable-replace key="s3-setup-host">{[host-pg1]}</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-user">postgres</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-config-owner">postgres:postgres</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-create-bucket">y</block-variable-replace>
|
||||
</block>
|
||||
@ -2330,6 +2319,7 @@
|
||||
|
||||
<block id="s3-setup" if="'{[s3-all]}' eq 'y'">
|
||||
<block-variable-replace key="s3-setup-host">{[host-repo1]}</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-user">{[br-user]}</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-config-owner">{[br-user]}:{[br-group]}</block-variable-replace>
|
||||
<block-variable-replace key="s3-setup-create-bucket">n</block-variable-replace>
|
||||
</block>
|
||||
|
@ -123,7 +123,11 @@ sub libcAutoExportTag
|
||||
'CFGCMD_EXPIRE',
|
||||
'CFGCMD_HELP',
|
||||
'CFGCMD_INFO',
|
||||
'CFGCMD_REPO_CREATE',
|
||||
'CFGCMD_REPO_GET',
|
||||
'CFGCMD_REPO_LS',
|
||||
'CFGCMD_REPO_PUT',
|
||||
'CFGCMD_REPO_RM',
|
||||
'CFGCMD_RESTORE',
|
||||
'CFGCMD_STANZA_CREATE',
|
||||
'CFGCMD_STANZA_DELETE',
|
||||
@ -140,6 +144,7 @@ sub libcAutoExportTag
|
||||
'CFGOPT_BACKUP_STANDBY',
|
||||
'CFGOPT_BUFFER_SIZE',
|
||||
'CFGOPT_CHECKSUM_PAGE',
|
||||
'CFGOPT_CIPHER_PASS',
|
||||
'CFGOPT_CMD_SSH',
|
||||
'CFGOPT_COMPRESS',
|
||||
'CFGOPT_COMPRESS_LEVEL',
|
||||
@ -155,6 +160,7 @@ sub libcAutoExportTag
|
||||
'CFGOPT_FILTER',
|
||||
'CFGOPT_FORCE',
|
||||
'CFGOPT_HOST_ID',
|
||||
'CFGOPT_IGNORE_MISSING',
|
||||
'CFGOPT_LINK_ALL',
|
||||
'CFGOPT_LINK_MAP',
|
||||
'CFGOPT_LOCK_PATH',
|
||||
@ -259,6 +265,7 @@ sub libcAutoExportTag
|
||||
'CFGOPT_PROCESS',
|
||||
'CFGOPT_PROCESS_MAX',
|
||||
'CFGOPT_PROTOCOL_TIMEOUT',
|
||||
'CFGOPT_RAW',
|
||||
'CFGOPT_RECOVERY_OPTION',
|
||||
'CFGOPT_RECURSE',
|
||||
'CFGOPT_REMOTE_TYPE',
|
||||
|
@ -66,7 +66,11 @@ SRCS = \
|
||||
command/control/start.c \
|
||||
command/control/stop.c \
|
||||
command/local/local.c \
|
||||
command/repo/create.c \
|
||||
command/repo/get.c \
|
||||
command/repo/ls.c \
|
||||
command/repo/put.c \
|
||||
command/repo/rm.c \
|
||||
command/restore/file.c \
|
||||
command/restore/protocol.c \
|
||||
command/restore/restore.c \
|
||||
@ -282,9 +286,21 @@ command/local/local.o: command/local/local.c build.auto.h command/archive/get/pr
|
||||
command/remote/remote.o: command/remote/remote.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h db/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h storage/remote/protocol.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/remote/remote.c -o command/remote/remote.o
|
||||
|
||||
command/repo/create.o: command/repo/create.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/s3/storage.h storage/s3/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/repo/create.c -o command/repo/create.o
|
||||
|
||||
command/repo/get.o: command/repo/get.c build.auto.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/repo/get.c -o command/repo/get.o
|
||||
|
||||
command/repo/ls.o: command/repo/ls.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/repo/ls.c -o command/repo/ls.o
|
||||
|
||||
command/repo/put.o: command/repo/put.c build.auto.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/repo/put.c -o command/repo/put.o
|
||||
|
||||
command/repo/rm.o: command/repo/rm.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/repo/rm.c -o command/repo/rm.o
|
||||
|
||||
command/restore/file.o: command/restore/file.c build.auto.h command/restore/file.h common/assert.h common/compress/helper.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/restore/file.c -o command/restore/file.o
|
||||
|
||||
@ -504,7 +520,7 @@ info/infoPg.o: info/infoPg.c build.auto.h common/assert.h common/crypto/common.h
|
||||
info/manifest.o: info/manifest.c build.auto.h command/backup/common.h common/assert.h common/compress/helper.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/mcv.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h info/info.h info/manifest.h postgres/interface.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c info/manifest.c -o info/manifest.o
|
||||
|
||||
main.o: main.c build.auto.h command/archive/get/get.h command/archive/push/push.h command/backup/backup.h command/check/check.h command/command.h command/control/start.h command/control/stop.h command/expire/expire.h command/help/help.h command/info/info.h command/local/local.h command/remote/remote.h command/repo/ls.h command/restore/restore.h command/stanza/create.h command/stanza/delete.h command/stanza/upgrade.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exit.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
main.o: main.c build.auto.h command/archive/get/get.h command/archive/push/push.h command/backup/backup.h command/check/check.h command/command.h command/control/start.h command/control/stop.h command/expire/expire.h command/help/help.h command/info/info.h command/local/local.h command/remote/remote.h command/repo/create.h command/repo/get.h command/repo/ls.h command/repo/put.h command/repo/rm.h command/restore/restore.h command/stanza/create.h command/stanza/delete.h command/stanza/upgrade.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exit.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c main.c -o main.o
|
||||
|
||||
postgres/client.o: postgres/client.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h common/wait.h postgres/client.h
|
||||
|
30
src/command/repo/create.c
Normal file
30
src/command/repo/create.c
Normal file
@ -0,0 +1,30 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Create Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "config/config.h"
|
||||
#include "storage/helper.h"
|
||||
#include "storage/s3/storage.intern.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
cmdRepoCreate(void)
|
||||
{
|
||||
FUNCTION_LOG_VOID(logLevelDebug);
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
if (strEq(storageType(storageRepo()), STORAGE_S3_TYPE_STR))
|
||||
{
|
||||
storageS3Request(
|
||||
(StorageS3 *)storageDriver(storageRepoWrite()), HTTP_VERB_PUT_STR, FSLASH_STR, NULL, NULL, true, false);
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
13
src/command/repo/create.h
Normal file
13
src/command/repo/create.h
Normal file
@ -0,0 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Create Command
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMAND_REPO_CREATE_H
|
||||
#define COMMAND_REPO_CREATE_H
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Create the repository (create path, bucket, etc.)
|
||||
void cmdRepoCreate(void);
|
||||
|
||||
#endif
|
117
src/command/repo/get.c
Normal file
117
src/command/repo/get.c
Normal file
@ -0,0 +1,117 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Get Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/handleWrite.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "config/config.h"
|
||||
#include "storage/helper.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Write source file to destination IO
|
||||
***********************************************************************************************************************************/
|
||||
int
|
||||
storageGetProcess(IoWrite *destination)
|
||||
{
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug)
|
||||
FUNCTION_LOG_PARAM(IO_READ, destination);
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
// Get source file
|
||||
const String *file = NULL;
|
||||
|
||||
if (strLstSize(cfgCommandParam()) == 1)
|
||||
file = strLstGet(cfgCommandParam(), 0);
|
||||
else
|
||||
THROW(ParamRequiredError, "source file required");
|
||||
|
||||
// Assume the file is missing
|
||||
int result = 1;
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
IoRead *source = storageReadIo(storageNewReadP(storageRepo(), file, .ignoreMissing = cfgOptionBool(cfgOptIgnoreMissing)));
|
||||
|
||||
// Add decryption if needed
|
||||
if (!cfgOptionBool(cfgOptRaw))
|
||||
{
|
||||
CipherType repoCipherType = cipherType(cfgOptionStr(cfgOptRepoCipherType));
|
||||
|
||||
if (repoCipherType != cipherTypeNone)
|
||||
{
|
||||
// Check for a passphrase parameter
|
||||
const String *cipherPass = cfgOptionStr(cfgOptCipherPass);
|
||||
|
||||
// If not passed as a parameter use the repo passphrase
|
||||
if (cipherPass == NULL)
|
||||
cipherPass = cfgOptionStr(cfgOptRepoCipherPass);
|
||||
|
||||
// Add encryption filter
|
||||
cipherBlockFilterGroupAdd(ioReadFilterGroup(source), repoCipherType, cipherModeDecrypt, cipherPass);
|
||||
}
|
||||
}
|
||||
|
||||
// Open source
|
||||
if (ioReadOpen(source))
|
||||
{
|
||||
// Open the destination file now that we know the source exists and is readable
|
||||
ioWriteOpen(destination);
|
||||
|
||||
// Copy data from source to destination
|
||||
Buffer *buffer = bufNew(ioBufferSize());
|
||||
|
||||
do
|
||||
{
|
||||
ioRead(source, buffer);
|
||||
ioWrite(destination, buffer);
|
||||
bufUsedZero(buffer);
|
||||
}
|
||||
while (!ioReadEof(source));
|
||||
|
||||
// Close the source and destination
|
||||
ioReadClose(source);
|
||||
ioWriteClose(destination);
|
||||
|
||||
// Source file exists
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(INT, result);
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
int
|
||||
cmdStorageGet(void)
|
||||
{
|
||||
FUNCTION_LOG_VOID(logLevelDebug);
|
||||
|
||||
// Assume the file is missing
|
||||
int result = 1;
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
TRY_BEGIN()
|
||||
{
|
||||
result = storageGetProcess(ioHandleWriteNew(STRDEF("stdout"), STDOUT_FILENO));
|
||||
}
|
||||
// Ignore write errors because it's possible (even likely) that this output is being piped to something like head which
|
||||
// will exit when it gets what it needs and leave us writing to a broken pipe. It would be better to just ignore the broken
|
||||
// pipe error but currently we don't store system error codes.
|
||||
CATCH(FileWriteError)
|
||||
{
|
||||
}
|
||||
TRY_END();
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(INT, result);
|
||||
}
|
13
src/command/repo/get.h
Normal file
13
src/command/repo/get.h
Normal file
@ -0,0 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Get Command
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMAND_STORAGE_GET_H
|
||||
#define COMMAND_STORAGE_GET_H
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Get a file from the repository
|
||||
int cmdStorageGet(void);
|
||||
|
||||
#endif
|
96
src/command/repo/put.c
Normal file
96
src/command/repo/put.c
Normal file
@ -0,0 +1,96 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Put Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/handleRead.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "config/config.h"
|
||||
#include "storage/helper.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Write source IO to destination file
|
||||
***********************************************************************************************************************************/
|
||||
void
|
||||
storagePutProcess(IoRead *source)
|
||||
{
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug)
|
||||
FUNCTION_LOG_PARAM(IO_READ, source);
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
// Get destination file
|
||||
const String *file = NULL;
|
||||
|
||||
if (strLstSize(cfgCommandParam()) == 1)
|
||||
file = strLstGet(cfgCommandParam(), 0);
|
||||
else
|
||||
THROW(ParamRequiredError, "destination file required");
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
StorageWrite *destination = storageNewWriteP(storageRepoWrite(), file);
|
||||
|
||||
// Add encryption if needed
|
||||
if (!cfgOptionBool(cfgOptRaw))
|
||||
{
|
||||
CipherType repoCipherType = cipherType(cfgOptionStr(cfgOptRepoCipherType));
|
||||
|
||||
if (repoCipherType != cipherTypeNone)
|
||||
{
|
||||
// Check for a passphrase parameter
|
||||
const String *cipherPass = cfgOptionStr(cfgOptCipherPass);
|
||||
|
||||
// If not passed as a parameter use the repo passphrase
|
||||
if (cipherPass == NULL)
|
||||
cipherPass = cfgOptionStr(cfgOptRepoCipherPass);
|
||||
|
||||
// Add encryption filter
|
||||
cipherBlockFilterGroupAdd(
|
||||
ioWriteFilterGroup(storageWriteIo(destination)), repoCipherType, cipherModeEncrypt, cipherPass);
|
||||
}
|
||||
}
|
||||
|
||||
// Open source and destination
|
||||
ioReadOpen(source);
|
||||
ioWriteOpen(storageWriteIo(destination));
|
||||
|
||||
// Copy data from source to destination
|
||||
Buffer *buffer = bufNew(ioBufferSize());
|
||||
|
||||
do
|
||||
{
|
||||
ioRead(source, buffer);
|
||||
ioWrite(storageWriteIo(destination), buffer);
|
||||
bufUsedZero(buffer);
|
||||
}
|
||||
while (!ioReadEof(source));
|
||||
|
||||
// Close the source and destination
|
||||
ioReadClose(source);
|
||||
ioWriteClose(storageWriteIo(destination));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
cmdStoragePut(void)
|
||||
{
|
||||
FUNCTION_LOG_VOID(logLevelDebug);
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
storagePutProcess(ioHandleReadNew(STRDEF("stdin"), STDIN_FILENO, IO_TIMEOUT_DEFAULT));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
13
src/command/repo/put.h
Normal file
13
src/command/repo/put.h
Normal file
@ -0,0 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Put Command
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMAND_STORAGE_PUT_H
|
||||
#define COMMAND_STORAGE_PUT_H
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Put a file into the repository
|
||||
void cmdStoragePut(void);
|
||||
|
||||
#endif
|
49
src/command/repo/rm.c
Normal file
49
src/command/repo/rm.c
Normal file
@ -0,0 +1,49 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Remove Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "config/config.h"
|
||||
#include "storage/helper.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
cmdStorageRemove(void)
|
||||
{
|
||||
FUNCTION_LOG_VOID(logLevelDebug);
|
||||
|
||||
// Get path
|
||||
const String *path = NULL;
|
||||
|
||||
if (strLstSize(cfgCommandParam()) == 1)
|
||||
path = strLstGet(cfgCommandParam(), 0);
|
||||
else if (strLstSize(cfgCommandParam()) > 1)
|
||||
THROW(ParamInvalidError, "only one path may be specified");
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Check if this is a file
|
||||
StorageInfo info = storageInfoP(storageRepo(), path, .ignoreMissing = true);
|
||||
|
||||
if (info.exists && info.type == storageTypeFile)
|
||||
{
|
||||
storageRemoveP(storageRepoWrite(), path);
|
||||
}
|
||||
// Else try to remove a path
|
||||
else
|
||||
{
|
||||
bool recurse = cfgOptionBool(cfgOptRecurse);
|
||||
|
||||
if (!recurse && strLstSize(storageListP(storageRepo(), path)) > 0)
|
||||
THROW(OptionInvalidError, CFGOPT_RECURSE " option must be used to delete non-empty path");
|
||||
|
||||
storagePathRemoveP(storageRepoWrite(), path, .recurse = recurse);
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
13
src/command/repo/rm.h
Normal file
13
src/command/repo/rm.h
Normal file
@ -0,0 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Repository Remove Command
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMAND_STORAGE_REMOVE_H
|
||||
#define COMMAND_STORAGE_REMOVE_H
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Remove paths/files from the repository
|
||||
void cmdStorageRemove(void);
|
||||
|
||||
#endif
|
@ -10,6 +10,11 @@ Common IO functions.
|
||||
|
||||
#include <common/io/read.h>
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Default IO timeout to use when nothing else is configured
|
||||
***********************************************************************************************************************************/
|
||||
#define IO_TIMEOUT_DEFAULT 60000
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
|
@ -14,7 +14,11 @@ STRING_EXTERN(CFGCMD_CHECK_STR, CFGCMD_CHECK
|
||||
STRING_EXTERN(CFGCMD_EXPIRE_STR, CFGCMD_EXPIRE);
|
||||
STRING_EXTERN(CFGCMD_HELP_STR, CFGCMD_HELP);
|
||||
STRING_EXTERN(CFGCMD_INFO_STR, CFGCMD_INFO);
|
||||
STRING_EXTERN(CFGCMD_REPO_CREATE_STR, CFGCMD_REPO_CREATE);
|
||||
STRING_EXTERN(CFGCMD_REPO_GET_STR, CFGCMD_REPO_GET);
|
||||
STRING_EXTERN(CFGCMD_REPO_LS_STR, CFGCMD_REPO_LS);
|
||||
STRING_EXTERN(CFGCMD_REPO_PUT_STR, CFGCMD_REPO_PUT);
|
||||
STRING_EXTERN(CFGCMD_REPO_RM_STR, CFGCMD_REPO_RM);
|
||||
STRING_EXTERN(CFGCMD_RESTORE_STR, CFGCMD_RESTORE);
|
||||
STRING_EXTERN(CFGCMD_STANZA_CREATE_STR, CFGCMD_STANZA_CREATE);
|
||||
STRING_EXTERN(CFGCMD_STANZA_DELETE_STR, CFGCMD_STANZA_DELETE);
|
||||
@ -119,6 +123,32 @@ static ConfigCommandData configCommandData[CFG_COMMAND_TOTAL] = CONFIG_COMMAND_L
|
||||
CONFIG_COMMAND_PARAMETER_ALLOWED(false)
|
||||
)
|
||||
|
||||
CONFIG_COMMAND
|
||||
(
|
||||
CONFIG_COMMAND_NAME(CFGCMD_REPO_CREATE)
|
||||
|
||||
CONFIG_COMMAND_INTERNAL(true)
|
||||
CONFIG_COMMAND_LOG_FILE(false)
|
||||
CONFIG_COMMAND_LOG_LEVEL_DEFAULT(logLevelInfo)
|
||||
CONFIG_COMMAND_LOCK_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_REMOTE_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_TYPE(lockTypeNone)
|
||||
CONFIG_COMMAND_PARAMETER_ALLOWED(false)
|
||||
)
|
||||
|
||||
CONFIG_COMMAND
|
||||
(
|
||||
CONFIG_COMMAND_NAME(CFGCMD_REPO_GET)
|
||||
|
||||
CONFIG_COMMAND_INTERNAL(true)
|
||||
CONFIG_COMMAND_LOG_FILE(false)
|
||||
CONFIG_COMMAND_LOG_LEVEL_DEFAULT(logLevelDebug)
|
||||
CONFIG_COMMAND_LOCK_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_REMOTE_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_TYPE(lockTypeNone)
|
||||
CONFIG_COMMAND_PARAMETER_ALLOWED(true)
|
||||
)
|
||||
|
||||
CONFIG_COMMAND
|
||||
(
|
||||
CONFIG_COMMAND_NAME(CFGCMD_REPO_LS)
|
||||
@ -132,6 +162,32 @@ static ConfigCommandData configCommandData[CFG_COMMAND_TOTAL] = CONFIG_COMMAND_L
|
||||
CONFIG_COMMAND_PARAMETER_ALLOWED(true)
|
||||
)
|
||||
|
||||
CONFIG_COMMAND
|
||||
(
|
||||
CONFIG_COMMAND_NAME(CFGCMD_REPO_PUT)
|
||||
|
||||
CONFIG_COMMAND_INTERNAL(true)
|
||||
CONFIG_COMMAND_LOG_FILE(false)
|
||||
CONFIG_COMMAND_LOG_LEVEL_DEFAULT(logLevelDebug)
|
||||
CONFIG_COMMAND_LOCK_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_REMOTE_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_TYPE(lockTypeNone)
|
||||
CONFIG_COMMAND_PARAMETER_ALLOWED(true)
|
||||
)
|
||||
|
||||
CONFIG_COMMAND
|
||||
(
|
||||
CONFIG_COMMAND_NAME(CFGCMD_REPO_RM)
|
||||
|
||||
CONFIG_COMMAND_INTERNAL(true)
|
||||
CONFIG_COMMAND_LOG_FILE(false)
|
||||
CONFIG_COMMAND_LOG_LEVEL_DEFAULT(logLevelDebug)
|
||||
CONFIG_COMMAND_LOCK_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_REMOTE_REQUIRED(false)
|
||||
CONFIG_COMMAND_LOCK_TYPE(lockTypeNone)
|
||||
CONFIG_COMMAND_PARAMETER_ALLOWED(true)
|
||||
)
|
||||
|
||||
CONFIG_COMMAND
|
||||
(
|
||||
CONFIG_COMMAND_NAME(CFGCMD_RESTORE)
|
||||
@ -236,6 +292,7 @@ STRING_EXTERN(CFGOPT_ARCHIVE_TIMEOUT_STR, CFGOPT_ARCHI
|
||||
STRING_EXTERN(CFGOPT_BACKUP_STANDBY_STR, CFGOPT_BACKUP_STANDBY);
|
||||
STRING_EXTERN(CFGOPT_BUFFER_SIZE_STR, CFGOPT_BUFFER_SIZE);
|
||||
STRING_EXTERN(CFGOPT_CHECKSUM_PAGE_STR, CFGOPT_CHECKSUM_PAGE);
|
||||
STRING_EXTERN(CFGOPT_CIPHER_PASS_STR, CFGOPT_CIPHER_PASS);
|
||||
STRING_EXTERN(CFGOPT_CMD_SSH_STR, CFGOPT_CMD_SSH);
|
||||
STRING_EXTERN(CFGOPT_COMPRESS_STR, CFGOPT_COMPRESS);
|
||||
STRING_EXTERN(CFGOPT_COMPRESS_LEVEL_STR, CFGOPT_COMPRESS_LEVEL);
|
||||
@ -251,6 +308,7 @@ STRING_EXTERN(CFGOPT_EXCLUDE_STR, CFGOPT_EXCLU
|
||||
STRING_EXTERN(CFGOPT_FILTER_STR, CFGOPT_FILTER);
|
||||
STRING_EXTERN(CFGOPT_FORCE_STR, CFGOPT_FORCE);
|
||||
STRING_EXTERN(CFGOPT_HOST_ID_STR, CFGOPT_HOST_ID);
|
||||
STRING_EXTERN(CFGOPT_IGNORE_MISSING_STR, CFGOPT_IGNORE_MISSING);
|
||||
STRING_EXTERN(CFGOPT_LINK_ALL_STR, CFGOPT_LINK_ALL);
|
||||
STRING_EXTERN(CFGOPT_LINK_MAP_STR, CFGOPT_LINK_MAP);
|
||||
STRING_EXTERN(CFGOPT_LOCK_PATH_STR, CFGOPT_LOCK_PATH);
|
||||
@ -355,6 +413,7 @@ STRING_EXTERN(CFGOPT_PG8_USER_STR, CFGOPT_PG8_U
|
||||
STRING_EXTERN(CFGOPT_PROCESS_STR, CFGOPT_PROCESS);
|
||||
STRING_EXTERN(CFGOPT_PROCESS_MAX_STR, CFGOPT_PROCESS_MAX);
|
||||
STRING_EXTERN(CFGOPT_PROTOCOL_TIMEOUT_STR, CFGOPT_PROTOCOL_TIMEOUT);
|
||||
STRING_EXTERN(CFGOPT_RAW_STR, CFGOPT_RAW);
|
||||
STRING_EXTERN(CFGOPT_RECOVERY_OPTION_STR, CFGOPT_RECOVERY_OPTION);
|
||||
STRING_EXTERN(CFGOPT_RECURSE_STR, CFGOPT_RECURSE);
|
||||
STRING_EXTERN(CFGOPT_REMOTE_TYPE_STR, CFGOPT_REMOTE_TYPE);
|
||||
@ -478,6 +537,14 @@ static ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
|
||||
CONFIG_OPTION_DEFINE_ID(cfgDefOptChecksumPage)
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
CONFIG_OPTION
|
||||
(
|
||||
CONFIG_OPTION_NAME(CFGOPT_CIPHER_PASS)
|
||||
CONFIG_OPTION_INDEX(0)
|
||||
CONFIG_OPTION_DEFINE_ID(cfgDefOptCipherPass)
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
CONFIG_OPTION
|
||||
(
|
||||
@ -598,6 +665,14 @@ static ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
|
||||
CONFIG_OPTION_DEFINE_ID(cfgDefOptHostId)
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
CONFIG_OPTION
|
||||
(
|
||||
CONFIG_OPTION_NAME(CFGOPT_IGNORE_MISSING)
|
||||
CONFIG_OPTION_INDEX(0)
|
||||
CONFIG_OPTION_DEFINE_ID(cfgDefOptIgnoreMissing)
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
CONFIG_OPTION
|
||||
(
|
||||
@ -1430,6 +1505,14 @@ static ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
|
||||
CONFIG_OPTION_DEFINE_ID(cfgDefOptProtocolTimeout)
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
CONFIG_OPTION
|
||||
(
|
||||
CONFIG_OPTION_NAME(CFGOPT_RAW)
|
||||
CONFIG_OPTION_INDEX(0)
|
||||
CONFIG_OPTION_DEFINE_ID(cfgDefOptRaw)
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
CONFIG_OPTION
|
||||
(
|
||||
|
@ -23,8 +23,16 @@ Command constants
|
||||
STRING_DECLARE(CFGCMD_HELP_STR);
|
||||
#define CFGCMD_INFO "info"
|
||||
STRING_DECLARE(CFGCMD_INFO_STR);
|
||||
#define CFGCMD_REPO_CREATE "repo-create"
|
||||
STRING_DECLARE(CFGCMD_REPO_CREATE_STR);
|
||||
#define CFGCMD_REPO_GET "repo-get"
|
||||
STRING_DECLARE(CFGCMD_REPO_GET_STR);
|
||||
#define CFGCMD_REPO_LS "repo-ls"
|
||||
STRING_DECLARE(CFGCMD_REPO_LS_STR);
|
||||
#define CFGCMD_REPO_PUT "repo-put"
|
||||
STRING_DECLARE(CFGCMD_REPO_PUT_STR);
|
||||
#define CFGCMD_REPO_RM "repo-rm"
|
||||
STRING_DECLARE(CFGCMD_REPO_RM_STR);
|
||||
#define CFGCMD_RESTORE "restore"
|
||||
STRING_DECLARE(CFGCMD_RESTORE_STR);
|
||||
#define CFGCMD_STANZA_CREATE "stanza-create"
|
||||
@ -40,7 +48,7 @@ Command constants
|
||||
#define CFGCMD_VERSION "version"
|
||||
STRING_DECLARE(CFGCMD_VERSION_STR);
|
||||
|
||||
#define CFG_COMMAND_TOTAL 16
|
||||
#define CFG_COMMAND_TOTAL 20
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Option constants
|
||||
@ -63,6 +71,8 @@ Option constants
|
||||
STRING_DECLARE(CFGOPT_BUFFER_SIZE_STR);
|
||||
#define CFGOPT_CHECKSUM_PAGE "checksum-page"
|
||||
STRING_DECLARE(CFGOPT_CHECKSUM_PAGE_STR);
|
||||
#define CFGOPT_CIPHER_PASS "cipher-pass"
|
||||
STRING_DECLARE(CFGOPT_CIPHER_PASS_STR);
|
||||
#define CFGOPT_CMD_SSH "cmd-ssh"
|
||||
STRING_DECLARE(CFGOPT_CMD_SSH_STR);
|
||||
#define CFGOPT_COMPRESS "compress"
|
||||
@ -93,6 +103,8 @@ Option constants
|
||||
STRING_DECLARE(CFGOPT_FORCE_STR);
|
||||
#define CFGOPT_HOST_ID "host-id"
|
||||
STRING_DECLARE(CFGOPT_HOST_ID_STR);
|
||||
#define CFGOPT_IGNORE_MISSING "ignore-missing"
|
||||
STRING_DECLARE(CFGOPT_IGNORE_MISSING_STR);
|
||||
#define CFGOPT_LINK_ALL "link-all"
|
||||
STRING_DECLARE(CFGOPT_LINK_ALL_STR);
|
||||
#define CFGOPT_LINK_MAP "link-map"
|
||||
@ -301,6 +313,8 @@ Option constants
|
||||
STRING_DECLARE(CFGOPT_PROCESS_MAX_STR);
|
||||
#define CFGOPT_PROTOCOL_TIMEOUT "protocol-timeout"
|
||||
STRING_DECLARE(CFGOPT_PROTOCOL_TIMEOUT_STR);
|
||||
#define CFGOPT_RAW "raw"
|
||||
STRING_DECLARE(CFGOPT_RAW_STR);
|
||||
#define CFGOPT_RECOVERY_OPTION "recovery-option"
|
||||
STRING_DECLARE(CFGOPT_RECOVERY_OPTION_STR);
|
||||
#define CFGOPT_RECURSE "recurse"
|
||||
@ -392,7 +406,7 @@ Option constants
|
||||
#define CFGOPT_TYPE "type"
|
||||
STRING_DECLARE(CFGOPT_TYPE_STR);
|
||||
|
||||
#define CFG_OPTION_TOTAL 173
|
||||
#define CFG_OPTION_TOTAL 176
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Command enum
|
||||
@ -406,7 +420,11 @@ typedef enum
|
||||
cfgCmdExpire,
|
||||
cfgCmdHelp,
|
||||
cfgCmdInfo,
|
||||
cfgCmdRepoCreate,
|
||||
cfgCmdRepoGet,
|
||||
cfgCmdRepoLs,
|
||||
cfgCmdRepoPut,
|
||||
cfgCmdRepoRm,
|
||||
cfgCmdRestore,
|
||||
cfgCmdStanzaCreate,
|
||||
cfgCmdStanzaDelete,
|
||||
@ -431,6 +449,7 @@ typedef enum
|
||||
cfgOptBackupStandby,
|
||||
cfgOptBufferSize,
|
||||
cfgOptChecksumPage,
|
||||
cfgOptCipherPass,
|
||||
cfgOptCmdSsh,
|
||||
cfgOptCompress,
|
||||
cfgOptCompressLevel,
|
||||
@ -446,6 +465,7 @@ typedef enum
|
||||
cfgOptFilter,
|
||||
cfgOptForce,
|
||||
cfgOptHostId,
|
||||
cfgOptIgnoreMissing,
|
||||
cfgOptLinkAll,
|
||||
cfgOptLinkMap,
|
||||
cfgOptLockPath,
|
||||
@ -550,6 +570,7 @@ typedef enum
|
||||
cfgOptProcess,
|
||||
cfgOptProcessMax,
|
||||
cfgOptProtocolTimeout,
|
||||
cfgOptRaw,
|
||||
cfgOptRecoveryOption,
|
||||
cfgOptRecurse,
|
||||
cfgOptRemoteType,
|
||||
|
@ -105,6 +105,30 @@ static ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LI
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_COMMAND
|
||||
(
|
||||
CFGDEFDATA_COMMAND_NAME("repo-create")
|
||||
|
||||
CFGDEFDATA_COMMAND_HELP_SUMMARY("Create the repository.")
|
||||
CFGDEFDATA_COMMAND_HELP_DESCRIPTION
|
||||
(
|
||||
"Creates the bucket if repo-type=s3.\n"
|
||||
"\n"
|
||||
"FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY."
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_COMMAND
|
||||
(
|
||||
CFGDEFDATA_COMMAND_NAME("repo-get")
|
||||
|
||||
CFGDEFDATA_COMMAND_HELP_SUMMARY("Get a file from the repository.")
|
||||
CFGDEFDATA_COMMAND_HELP_DESCRIPTION
|
||||
(
|
||||
"Similar to the unix cat command but options are different."
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_COMMAND
|
||||
(
|
||||
CFGDEFDATA_COMMAND_NAME("repo-ls")
|
||||
@ -117,6 +141,32 @@ static ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LI
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_COMMAND
|
||||
(
|
||||
CFGDEFDATA_COMMAND_NAME("repo-put")
|
||||
|
||||
CFGDEFDATA_COMMAND_HELP_SUMMARY("Put a file in the repository.")
|
||||
CFGDEFDATA_COMMAND_HELP_DESCRIPTION
|
||||
(
|
||||
"Similar to the unix tee command but options and behavior are different.\n"
|
||||
"\n"
|
||||
"FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY."
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_COMMAND
|
||||
(
|
||||
CFGDEFDATA_COMMAND_NAME("repo-rm")
|
||||
|
||||
CFGDEFDATA_COMMAND_HELP_SUMMARY("Remove paths/files in the repository.")
|
||||
CFGDEFDATA_COMMAND_HELP_DESCRIPTION
|
||||
(
|
||||
"Similar to the unix rm command but options are different.\n"
|
||||
"\n"
|
||||
"FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY."
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_COMMAND
|
||||
(
|
||||
CFGDEFDATA_COMMAND_NAME("restore")
|
||||
@ -529,7 +579,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -586,6 +640,25 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
)
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
CFGDEFDATA_OPTION
|
||||
(
|
||||
CFGDEFDATA_OPTION_NAME("cipher-pass")
|
||||
CFGDEFDATA_OPTION_REQUIRED(false)
|
||||
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
|
||||
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeString)
|
||||
CFGDEFDATA_OPTION_INTERNAL(true)
|
||||
|
||||
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
|
||||
CFGDEFDATA_OPTION_SECURE(false)
|
||||
|
||||
CFGDEFDATA_OPTION_COMMAND_LIST
|
||||
(
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
)
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
CFGDEFDATA_OPTION
|
||||
(
|
||||
@ -613,7 +686,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -721,7 +798,9 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -801,7 +880,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -844,7 +927,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -890,7 +977,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -964,7 +1055,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaUpgrade)
|
||||
@ -1215,6 +1310,40 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
)
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
CFGDEFDATA_OPTION
|
||||
(
|
||||
CFGDEFDATA_OPTION_NAME("ignore-missing")
|
||||
CFGDEFDATA_OPTION_REQUIRED(true)
|
||||
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
|
||||
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeBoolean)
|
||||
CFGDEFDATA_OPTION_INTERNAL(false)
|
||||
|
||||
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
|
||||
CFGDEFDATA_OPTION_SECURE(false)
|
||||
|
||||
CFGDEFDATA_OPTION_COMMAND_LIST
|
||||
(
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_LIST
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_DEFAULT("0")
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoGet)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_HELP_SUMMARY("Ignore missing source file.")
|
||||
CFGDEFDATA_OPTION_OPTIONAL_HELP_DESCRIPTION
|
||||
(
|
||||
"Exit with 1 if the source file is missing but don't throw an error."
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
CFGDEFDATA_OPTION
|
||||
(
|
||||
@ -1350,7 +1479,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -1411,7 +1544,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -1475,7 +1612,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -1529,7 +1670,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -1571,7 +1716,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -1614,7 +1763,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -1695,7 +1848,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2333,7 +2490,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2409,7 +2570,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2423,6 +2588,37 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
)
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
CFGDEFDATA_OPTION
|
||||
(
|
||||
CFGDEFDATA_OPTION_NAME("raw")
|
||||
CFGDEFDATA_OPTION_REQUIRED(true)
|
||||
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
|
||||
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeBoolean)
|
||||
CFGDEFDATA_OPTION_INTERNAL(false)
|
||||
|
||||
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
|
||||
CFGDEFDATA_OPTION_SECURE(false)
|
||||
|
||||
CFGDEFDATA_OPTION_HELP_SECTION("general")
|
||||
CFGDEFDATA_OPTION_HELP_SUMMARY("Do not transform data.")
|
||||
CFGDEFDATA_OPTION_HELP_DESCRIPTION
|
||||
(
|
||||
"Do not transform (i.e, encrypt, decompress, etc.) data for the current command."
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_COMMAND_LIST
|
||||
(
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_LIST
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_DEFAULT("0")
|
||||
)
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
CFGDEFDATA_OPTION
|
||||
(
|
||||
@ -2485,6 +2681,7 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND_LIST
|
||||
(
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_LIST
|
||||
@ -2501,6 +2698,17 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
"All subpaths and their files will be included in the output."
|
||||
)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoRm)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_HELP_SUMMARY("Remove all sub file/paths.")
|
||||
CFGDEFDATA_OPTION_OPTIONAL_HELP_DESCRIPTION
|
||||
(
|
||||
"All subpaths and their files will be removed."
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@ -2523,7 +2731,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2567,7 +2779,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2620,7 +2836,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2705,7 +2925,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -2782,7 +3006,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStart)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStop)
|
||||
@ -2822,7 +3050,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStart)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStop)
|
||||
@ -2863,7 +3095,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStart)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStop)
|
||||
@ -2903,7 +3139,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStart)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStop)
|
||||
@ -2942,7 +3182,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStart)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStop)
|
||||
@ -2985,7 +3229,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStart)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStop)
|
||||
@ -3032,7 +3280,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3236,7 +3488,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3284,7 +3540,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3332,7 +3592,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3380,7 +3644,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3428,7 +3696,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3476,7 +3748,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3524,7 +3800,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3572,7 +3852,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3622,7 +3906,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3670,7 +3958,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3721,7 +4013,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3777,7 +4073,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -3831,7 +4131,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -4085,6 +4389,11 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdCheck)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdExpire)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdInfo)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoGet)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoLs)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoPut)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRepoRm)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaCreate)
|
||||
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdStanzaDelete)
|
||||
@ -4102,6 +4411,41 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
|
||||
CFGDEFDATA_OPTION_OPTIONAL_REQUIRED(false)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoCreate)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_REQUIRED(false)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoGet)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_REQUIRED(false)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoLs)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_REQUIRED(false)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoPut)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_REQUIRED(false)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRepoRm)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_REQUIRED(false)
|
||||
)
|
||||
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND_OVERRIDE
|
||||
(
|
||||
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdStart)
|
||||
|
@ -18,7 +18,11 @@ typedef enum
|
||||
cfgDefCmdExpire,
|
||||
cfgDefCmdHelp,
|
||||
cfgDefCmdInfo,
|
||||
cfgDefCmdRepoCreate,
|
||||
cfgDefCmdRepoGet,
|
||||
cfgDefCmdRepoLs,
|
||||
cfgDefCmdRepoPut,
|
||||
cfgDefCmdRepoRm,
|
||||
cfgDefCmdRestore,
|
||||
cfgDefCmdStanzaCreate,
|
||||
cfgDefCmdStanzaDelete,
|
||||
@ -57,6 +61,7 @@ typedef enum
|
||||
cfgDefOptBackupStandby,
|
||||
cfgDefOptBufferSize,
|
||||
cfgDefOptChecksumPage,
|
||||
cfgDefOptCipherPass,
|
||||
cfgDefOptCmdSsh,
|
||||
cfgDefOptCompress,
|
||||
cfgDefOptCompressLevel,
|
||||
@ -72,6 +77,7 @@ typedef enum
|
||||
cfgDefOptFilter,
|
||||
cfgDefOptForce,
|
||||
cfgDefOptHostId,
|
||||
cfgDefOptIgnoreMissing,
|
||||
cfgDefOptLinkAll,
|
||||
cfgDefOptLinkMap,
|
||||
cfgDefOptLockPath,
|
||||
@ -99,6 +105,7 @@ typedef enum
|
||||
cfgDefOptProcess,
|
||||
cfgDefOptProcessMax,
|
||||
cfgDefOptProtocolTimeout,
|
||||
cfgDefOptRaw,
|
||||
cfgDefOptRecoveryOption,
|
||||
cfgDefOptRecurse,
|
||||
cfgDefOptRemoteType,
|
||||
|
@ -141,6 +141,14 @@ static const struct option optionList[] =
|
||||
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | cfgOptChecksumPage,
|
||||
},
|
||||
|
||||
// cipher-pass option
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
.name = CFGOPT_CIPHER_PASS,
|
||||
.has_arg = required_argument,
|
||||
.val = PARSE_OPTION_FLAG | cfgOptCipherPass,
|
||||
},
|
||||
|
||||
// cmd-ssh option
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
@ -306,6 +314,13 @@ static const struct option optionList[] =
|
||||
.val = PARSE_OPTION_FLAG | cfgOptHostId,
|
||||
},
|
||||
|
||||
// ignore-missing option
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
.name = CFGOPT_IGNORE_MISSING,
|
||||
.val = PARSE_OPTION_FLAG | cfgOptIgnoreMissing,
|
||||
},
|
||||
|
||||
// link-all option
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
@ -1686,6 +1701,13 @@ static const struct option optionList[] =
|
||||
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | cfgOptProtocolTimeout,
|
||||
},
|
||||
|
||||
// raw option
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
.name = CFGOPT_RAW,
|
||||
.val = PARSE_OPTION_FLAG | cfgOptRaw,
|
||||
},
|
||||
|
||||
// recovery-option option
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
{
|
||||
@ -2346,6 +2368,7 @@ static const ConfigOption optionResolveOrder[] =
|
||||
cfgOptBackupStandby,
|
||||
cfgOptBufferSize,
|
||||
cfgOptChecksumPage,
|
||||
cfgOptCipherPass,
|
||||
cfgOptCmdSsh,
|
||||
cfgOptCompress,
|
||||
cfgOptCompressLevel,
|
||||
@ -2360,6 +2383,7 @@ static const ConfigOption optionResolveOrder[] =
|
||||
cfgOptExclude,
|
||||
cfgOptFilter,
|
||||
cfgOptHostId,
|
||||
cfgOptIgnoreMissing,
|
||||
cfgOptLinkAll,
|
||||
cfgOptLinkMap,
|
||||
cfgOptLockPath,
|
||||
@ -2464,6 +2488,7 @@ static const ConfigOption optionResolveOrder[] =
|
||||
cfgOptProcess,
|
||||
cfgOptProcessMax,
|
||||
cfgOptProtocolTimeout,
|
||||
cfgOptRaw,
|
||||
cfgOptRecurse,
|
||||
cfgOptRemoteType,
|
||||
cfgOptRepoCipherType,
|
||||
|
36
src/main.c
36
src/main.c
@ -19,7 +19,11 @@ Main
|
||||
#include "command/info/info.h"
|
||||
#include "command/local/local.h"
|
||||
#include "command/remote/remote.h"
|
||||
#include "command/repo/create.h"
|
||||
#include "command/repo/get.h"
|
||||
#include "command/repo/ls.h"
|
||||
#include "command/repo/put.h"
|
||||
#include "command/repo/rm.h"
|
||||
#include "command/restore/restore.h"
|
||||
#include "command/stanza/create.h"
|
||||
#include "command/stanza/delete.h"
|
||||
@ -158,6 +162,22 @@ main(int argListSize, const char *argList[])
|
||||
break;
|
||||
}
|
||||
|
||||
// Repository create command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRepoCreate:
|
||||
{
|
||||
cmdRepoCreate();
|
||||
break;
|
||||
}
|
||||
|
||||
// Repository get file command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRepoGet:
|
||||
{
|
||||
result = cmdStorageGet();
|
||||
break;
|
||||
}
|
||||
|
||||
// Repository list paths/files command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRepoLs:
|
||||
@ -166,6 +186,22 @@ main(int argListSize, const char *argList[])
|
||||
break;
|
||||
}
|
||||
|
||||
// Repository put file command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRepoPut:
|
||||
{
|
||||
cmdStoragePut();
|
||||
break;
|
||||
}
|
||||
|
||||
// Repository remove paths/files command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRepoRm:
|
||||
{
|
||||
cmdStorageRemove();
|
||||
break;
|
||||
}
|
||||
|
||||
// Restore command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRestore:
|
||||
|
@ -646,10 +646,18 @@ unit:
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: repo
|
||||
total: 1
|
||||
total: 4
|
||||
|
||||
coverage:
|
||||
command/repo/get: full
|
||||
command/repo/ls: full
|
||||
command/repo/put: full
|
||||
command/repo/rm: full
|
||||
|
||||
include:
|
||||
# command/repo/create is currently for testing purposes only so coverage is not provided except in integration. In the
|
||||
# future this will probably be rolled into a custom object store server implementation.
|
||||
- command/repo/create
|
||||
|
||||
# **********************************************************************************************************************************
|
||||
# Integration tests
|
||||
|
@ -1,6 +1,7 @@
|
||||
/***********************************************************************************************************************************
|
||||
Test Repo Commands
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/io/bufferRead.h"
|
||||
#include "common/io/bufferWrite.h"
|
||||
#include "storage/posix/storage.h"
|
||||
|
||||
@ -18,6 +19,19 @@ testRun(void)
|
||||
Storage *storageTest = storagePosixNew(
|
||||
strNew(testPath()), STORAGE_MODE_FILE_DEFAULT, STORAGE_MODE_PATH_DEFAULT, true, NULL);
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("cmdRepoCreate()"))
|
||||
{
|
||||
StringList *argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--repo-path=%s/repo", testPath()));
|
||||
harnessCfgLoad(cfgCmdRepoCreate, argList);
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("noop on non-S3 storage");
|
||||
|
||||
TEST_RESULT_VOID(cmdRepoCreate(), "repo create");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("cmdStorageList() and storageListRender()"))
|
||||
{
|
||||
@ -172,5 +186,241 @@ testRun(void)
|
||||
" check output");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("cmdStoragePut() and cmdStorageGet()"))
|
||||
{
|
||||
// Set buffer size small so copy loops get exercised
|
||||
size_t oldBufferSize = ioBufferSize();
|
||||
ioBufferSizeSet(8);
|
||||
|
||||
// Needed for tests
|
||||
setenv("PGBACKREST_REPO1_CIPHER_PASS", "xxx", true);
|
||||
|
||||
// Test files and buffers
|
||||
const String *fileName = STRDEF("file.txt");
|
||||
const Buffer *fileBuffer = BUFSTRDEF("TESTFILE");
|
||||
|
||||
const String *fileEncName = STRDEF("file-enc.txt");
|
||||
const Buffer *fileEncBuffer = BUFSTRDEF("TESTFILE-ENC");
|
||||
|
||||
const String *fileEncCustomName = STRDEF("file-enc-custom.txt");
|
||||
const Buffer *fileEncCustomBuffer = BUFSTRDEF("TESTFILE-ENC-CUSTOM");
|
||||
|
||||
const String *fileRawName = STRDEF("file-raw.txt");
|
||||
const Buffer *fileRawBuffer = BUFSTRDEF("TESTFILE-RAW");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error when missing destination");
|
||||
|
||||
StringList *argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
harnessCfgLoad(cfgCmdRepoPut, argList);
|
||||
|
||||
TEST_ERROR(storagePutProcess(ioBufferReadNew(fileBuffer)), ParamRequiredError, "destination file required");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("put a file");
|
||||
|
||||
strLstAdd(argList, fileName);
|
||||
harnessCfgLoad(cfgCmdRepoPut, argList);
|
||||
|
||||
TEST_RESULT_VOID(storagePutProcess(ioBufferReadNew(fileBuffer)), "put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("put an encrypted file");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_REPO1_CIPHER_TYPE "=" CIPHER_TYPE_AES_256_CBC);
|
||||
strLstAdd(argList, fileEncName);
|
||||
harnessCfgLoad(cfgCmdRepoPut, argList);
|
||||
|
||||
TEST_RESULT_VOID(storagePutProcess(ioBufferReadNew(fileEncBuffer)), "put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("put an encrypted file with custom key");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_REPO1_CIPHER_TYPE "=" CIPHER_TYPE_AES_256_CBC);
|
||||
strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom");
|
||||
strLstAdd(argList, fileEncCustomName);
|
||||
harnessCfgLoad(cfgCmdRepoPut, argList);
|
||||
|
||||
TEST_RESULT_VOID(storagePutProcess(ioBufferReadNew(fileEncCustomBuffer)), "put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("put a raw file");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_REPO1_CIPHER_TYPE "=" CIPHER_TYPE_AES_256_CBC);
|
||||
strLstAddZ(argList, "--raw");
|
||||
strLstAdd(argList, fileRawName);
|
||||
harnessCfgLoad(cfgCmdRepoPut, argList);
|
||||
|
||||
// Get stdin from a file
|
||||
int stdinSave = dup(STDIN_FILENO);
|
||||
const String *stdinFile = storagePathP(storageRepo(), STRDEF("stdin.txt"));
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), stdinFile), fileRawBuffer);
|
||||
|
||||
THROW_ON_SYS_ERROR(freopen(strPtr(stdinFile), "r", stdin) == NULL, FileWriteError, "unable to reopen stdin");
|
||||
|
||||
TEST_RESULT_VOID(cmdStoragePut(), "put");
|
||||
|
||||
// Restore normal stdout
|
||||
dup2(stdinSave, STDIN_FILENO);
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error when missing source");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
harnessCfgLoad(cfgCmdRepoGet, argList);
|
||||
|
||||
TEST_ERROR(storageGetProcess(ioBufferWriteNew(bufNew(0))), ParamRequiredError, "source file required");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("get a file");
|
||||
|
||||
strLstAdd(argList, fileName);
|
||||
harnessCfgLoad(cfgCmdRepoGet, argList);
|
||||
|
||||
Buffer *writeBuffer = bufNew(0);
|
||||
TEST_RESULT_INT(storageGetProcess(ioBufferWriteNew(writeBuffer)), 0, "get");
|
||||
TEST_RESULT_BOOL(bufEq(writeBuffer, fileBuffer), true, " get matches put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("get an encrypted file");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_REPO1_CIPHER_TYPE "=" CIPHER_TYPE_AES_256_CBC);
|
||||
strLstAdd(argList, fileEncName);
|
||||
harnessCfgLoad(cfgCmdRepoGet, argList);
|
||||
|
||||
writeBuffer = bufNew(0);
|
||||
TEST_RESULT_INT(storageGetProcess(ioBufferWriteNew(writeBuffer)), 0, "get");
|
||||
TEST_RESULT_BOOL(bufEq(writeBuffer, fileEncBuffer), true, " get matches put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("get an encrypted file with custom key");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_REPO1_CIPHER_TYPE "=" CIPHER_TYPE_AES_256_CBC);
|
||||
strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom");
|
||||
strLstAdd(argList, fileEncCustomName);
|
||||
harnessCfgLoad(cfgCmdRepoGet, argList);
|
||||
|
||||
writeBuffer = bufNew(0);
|
||||
TEST_RESULT_INT(storageGetProcess(ioBufferWriteNew(writeBuffer)), 0, "get");
|
||||
TEST_RESULT_BOOL(bufEq(writeBuffer, fileEncCustomBuffer), true, " get matches put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("get a raw file");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_REPO1_CIPHER_TYPE "=" CIPHER_TYPE_AES_256_CBC);
|
||||
strLstAddZ(argList, "--raw");
|
||||
strLstAdd(argList, fileRawName);
|
||||
harnessCfgLoad(cfgCmdRepoGet, argList);
|
||||
|
||||
TEST_LOG("get");
|
||||
|
||||
// Redirect stdout to a file
|
||||
int stdoutSave = dup(STDOUT_FILENO);
|
||||
String *stdoutFile = strNewFmt("%s/repo/stdout.txt", testPath());
|
||||
|
||||
THROW_ON_SYS_ERROR(freopen(strPtr(stdoutFile), "w", stdout) == NULL, FileWriteError, "unable to reopen stdout");
|
||||
|
||||
// Not in a test wrapper to avoid writing to stdout
|
||||
ASSERT(cmdStorageGet() == 0);
|
||||
|
||||
// Restore normal stdout
|
||||
dup2(stdoutSave, STDOUT_FILENO);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strNewBuf(storageGetP(storageNewReadP(storageRepo(), stdoutFile))), strNewBuf(fileRawBuffer), " get matches put");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("ignore missing file");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--" CFGOPT_REPO1_PATH "=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--" CFGOPT_IGNORE_MISSING);
|
||||
strLstAddZ(argList, BOGUS_STR);
|
||||
harnessCfgLoad(cfgCmdRepoGet, argList);
|
||||
|
||||
writeBuffer = bufNew(0);
|
||||
TEST_RESULT_INT(storageGetProcess(ioBufferWriteNew(bufNew(0))), 1, "get");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Reset env
|
||||
unsetenv("PGBACKREST_REPO1_CIPHER_PASS");
|
||||
|
||||
// Reset buffer size
|
||||
ioBufferSizeSet(oldBufferSize);
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("cmdStorageRemove()"))
|
||||
{
|
||||
StringList *argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--repo-path=%s/repo", testPath()));
|
||||
harnessCfgLoad(cfgCmdRepoRm, argList);
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("remove missing path");
|
||||
|
||||
TEST_RESULT_VOID(cmdStorageRemove(), "remove");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("remove empty path");
|
||||
|
||||
strLstAddZ(argList, "path");
|
||||
harnessCfgLoad(cfgCmdRepoRm, argList);
|
||||
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageRepoWrite(), STRDEF("path")), "add path");
|
||||
TEST_RESULT_VOID(cmdStorageRemove(), "remove path");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageRepo(), STRDEF("path")), false, " check path removed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("fail when path is not empty and no recurse");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), strNew("path/aaa.txt")), BUFSTRDEF("TESTDATA")), "add path/file");
|
||||
TEST_ERROR(cmdStorageRemove(), OptionInvalidError, "recurse option must be used to delete non-empty path");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("succeed when path is not empty and no recurse");
|
||||
|
||||
cfgOptionSet(cfgOptRecurse, cfgSourceParam, BOOL_TRUE_VAR);
|
||||
TEST_RESULT_VOID(cmdStorageRemove(), "remove path");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error on more than one path");
|
||||
|
||||
strLstAddZ(argList, "repo2");
|
||||
harnessCfgLoad(cfgCmdRepoRm, argList);
|
||||
|
||||
TEST_ERROR(cmdStorageRemove(), ParamInvalidError, "only one path may be specified");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("remove file");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNewFmt("--repo-path=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "path/aaa.txt");
|
||||
harnessCfgLoad(cfgCmdRepoRm, argList);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), strNew("path/aaa.txt")), BUFSTRDEF("TESTDATA")), "add path/file");
|
||||
TEST_RESULT_VOID(cmdStorageRemove(), "remove file");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageRepo(), STRDEF("path/aaa.txt")), false, " check file removed");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageRepo(), STRDEF("path")), true, " check path exists");
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RESULT_VOID();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user