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 00000000000..00e89b4938c --- /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 = "" + 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 6572eefd3dc..6c626355929 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 +