Skip to content

Commit

Permalink
docs: add example to Selection Type = Sql Query
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
bruno-at-bareos and joergsteffens committed Aug 22, 2022
1 parent cf639da commit 5948aff
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 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;"
}
Expand Up @@ -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

0 comments on commit 5948aff

Please sign in to comment.