Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBruno Friedmann <bruno.friedmann@bareos.com>2022-07-20 17:32:48 +0300
committerBruno Friedmann <bruno.friedmann@bareos.com>2022-08-22 16:55:46 +0300
commit5948aff60bc7dc2f9268c729f2dd81321772bc2c (patch)
tree04496a041b9d4b33e6433152c880f285fef07059 /docs
parentcf639da8fe82dbac2cf3f675143ac9fc876fb935 (diff)
docs: add example to Selection Type = Sql Query
- show query example for `Selection Pattern` when `Selection Type` is Sql Query. Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com> Co-authored-by: Jörg Steffens <joergsteffens@users.noreply.github.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/manuals/source/include/config/DirSelectionPatterns-sql1.conf19
-rw-r--r--docs/manuals/source/manually_added_config_directive_descriptions/dir-job-SelectionPattern.rst.inc6
2 files changed, 25 insertions, 0 deletions
diff --git a/docs/manuals/source/include/config/DirSelectionPatterns-sql1.conf b/docs/manuals/source/include/config/DirSelectionPatterns-sql1.conf
new file mode 100644
index 000000000..00e89b493
--- /dev/null
+++ b/docs/manuals/source/include/config/DirSelectionPatterns-sql1.conf
@@ -0,0 +1,19 @@
+
+# SQL selecting all jobid in pool "Full"
+# which is a terminated backup (T,W)
+# and was never copied or migrated (PriorJobid 0).
+
+Job {
+ Name = "<name>"
+ JobDefs = "DefaultJob"
+ Type = Migrate
+ Selection Type = SQL Query
+ # Multiple lines instructions is available since version 21.0.0
+ Selection Pattern = "WITH pids AS
+ ( SELECT poolid FROM pool WHERE name = 'Full' )
+ SELECT jobid FROM job j, pids p
+ WHERE j.poolid=p.poolid
+ AND type='B'
+ AND jobstatus IN ('T','W')
+ AND priorjobid = 0;"
+}
diff --git a/docs/manuals/source/manually_added_config_directive_descriptions/dir-job-SelectionPattern.rst.inc b/docs/manuals/source/manually_added_config_directive_descriptions/dir-job-SelectionPattern.rst.inc
index 6572eefd3..6c6263559 100644
--- a/docs/manuals/source/manually_added_config_directive_descriptions/dir-job-SelectionPattern.rst.inc
+++ b/docs/manuals/source/manually_added_config_directive_descriptions/dir-job-SelectionPattern.rst.inc
@@ -5,3 +5,9 @@ For the OldestVolume and SmallestVolume, this Selection pattern is not used (ign
For the Client, Volume, and Job keywords, this pattern must be a valid regular expression that will filter the appropriate item names found in the Pool.
For the SQLQuery keyword, this pattern must be a valid :command:`SELECT` SQL statement that returns JobIds.
+
+Example:
+
+.. literalinclude:: /include/config/DirSelectionPatterns-sql1.conf
+ :language: bareosconfig
+