{"id":13435,"date":"2020-02-11T00:12:05","date_gmt":"2020-02-10T23:12:05","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/"},"modified":"2020-02-11T00:12:05","modified_gmt":"2020-02-10T23:12:05","slug":"control-m-em-emdef-utility-folders","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/","title":{"rendered":"Control-M\/EM &#8211; emdef utility &#8211; Folders"},"content":{"rendered":"<p>In a previous <a href=\"https:\/\/www.dbi-services.com\/blog\/?p=36948\" rel=\"noopener noreferrer\" target=\"_blank\">blog <\/a>I talked about the emdef utility and how it can help to manage and standardize calendars across multiple environments. In this blog we will deal with folders definitions in the Control-M\/EM database. This can be used to extract data as a backup, or for migration from one to another environment.<br \/>\n<!--more--><\/p>\n<p>The emdef need some parameters which vary according to the method to be executed, methods related to folders are:<\/p>\n<ul>\n<li><b>exportdeffolder<\/b>: Exports folders and SMART Folders<\/li>\n<li><b>deffolder<\/b>: Imports folders and SMART Folders<\/li>\n<li><b>updatedef<\/b>: Updates specified parameter<\/li>\n<\/ul>\n<h2>Basic parameters definition<\/h2>\n<p>Basic parameters not change between calendars and folders method, so to run emdef there are some fixed parameters whatever the method used, the syntax should be like:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef &lt;METHOD_TO_USE&gt; &#x5B;-USERNAME &lt;userName&gt; &#x5B;-PASSWORD &lt;password&gt;] | -PASSWORD_FILE &lt;passwordFile&gt;] -HOST &lt;guiServerName&gt; ...<\/pre>\n<ul>\n<li><b>userName<\/b>: The Control-M\/EM user name<\/li>\n<li><b>password<\/b>: The control-M\/EM user password<\/li>\n<li><b>passwordFile<\/b>: Here you have the choice to put the user and password in the command line, or use the passwordFile which is a file containing an unencrypted user name and password on separate lines in the below format:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">user=userName\npassword=password<\/pre>\n<p>\tI personally recommend this practice to avoid adding user\/password in the command line, on the other hand you have to correctly set file permissions!<\/li>\n<li><b>guiServerName<\/b>: Control-M\/EM GUI server host name or IP address<\/li>\n<\/ul>\n<p>Let&#8217;s move to methods to better understand this utility.<\/p>\n<h2>Methods definition<\/h2>\n<h3>exportdeffolder<\/h3>\n<p>The exportdeffolder utility exports folders from the Control-M\/EM database to a file. To do so, a file of arguments should be prepared and contains statements that specify an existing folder, SMART Folders and Sub-folders. The specified folders are exported to an output file. Then, output files created with the exportdeffolder utility can be used as import files with the deffolder utility.<\/p>\n<p>For example, on DEV you can define, test, and validate jobs configuration, then export job definitions to an output file using exportdeffolder, make modifications (needed on TEST Env) to the definitions, and use the file modified as the input file when running deffolder on Test environment. In this way, you can be sure that jobs are identical between DEV and TEST environments.<\/p>\n<p>To run the exportdeffolder utility, you need to specify basic parameters shown before plus the below one:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">-arg &lt;argFileName&gt; -out &lt;outputFileName&gt;<\/pre>\n<p>        =&gt; Path and name of the arguments file containing the exportdeffolder specifications, and the output file you want.<br \/>\n<strong>Example: Export all folders configuration with name match DEV*<\/strong><\/p>\n<ol>\n<li>Create an argument file &#8220;exportALLdevfolder.xml&#8221; like the following:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;TERMS&gt;\n  &lt;TERM&gt;\n    &lt;PARAM NAME=&quot;FOLDER_NAME&quot; OP=&quot;LIKE&quot; VALUE=&quot;DEV*&quot;\/&gt;\n  &lt;\/TERM&gt;\n&lt;\/TERMS&gt;\n<\/pre>\n<\/li>\n<li>Create password file credentials.txt:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\nuser=emuser\npassword=MyEmUserPass\n<\/pre>\n<\/li>\n<li>Execute the command:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef exportdeffolder -pf &lt;passwordFile&gt; -s &lt;guiServerName&gt; -arg &lt;argFileName&gt; -out &lt;outputFileName&gt;<\/pre>\n<p>Which correspond to:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef exportdeffolder -pf credentials.txt -s guiserverhostname -arg exportALLdevfolder.xml -out AllDevFolders.xml <\/pre>\n<\/li>\n<\/ol>\n<h3>deffolder<\/h3>\n<p>The deffolder utility imports folders and SMART Folders into the Control-M\/EM database. The input file is usually a file generated from exportdeffolder or from the gui, anyway it should contains statements that specify an existing folders or new folders (valid for SMART Folders).<br \/>\nSo, if the folders don&#8217;t exist, the utility creates them. If the folders already exist, a message is issued indicating that the folders already exist, there is a way to overwrite the existing folders.<\/p>\n<p>To run the deffolder utility, you need to specify basic parameters shown before plus the below one:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">-src &lt;srcFileName&gt; &#x5B;\/a] &#x5B;\/o] &#x5B;\/t] &#x5B;\/v]<\/pre>\n<p>        =&gt; -src: to specify the imput xml file that contains the folders definitions<br \/>\n        =&gt; \/a: directs the utility to automatically reset the &#8220;Created By&#8221; parameter to the current Control-M\/EM user when these two values do not match &#8211; OPTIONAL<br \/>\n        =&gt; \/o: directs the utility to overwrite any existing folders &#8211; OPTIONAL<br \/>\n        =&gt; \/t: Operate on a single folder at a time, to reduce process memory &#8211; OPTIONAL<br \/>\n        =&gt; \/v: Used to receive verbose messages &#8211; OPTIONAL<\/p>\n<p><strong>Example: Import folders configuration that has been exported in the previous method<\/strong><\/p>\n<ol>\n<li>Use the same file credentials.txt created before <\/li>\n<li>Execute the command:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef deffolder -pf &lt;passwordFile&gt; -s &lt;guiServerName&gt; -src &lt;srcFileName&gt;  &#x5B;\/a] &#x5B;\/o] &#x5B;\/t] &#x5B;\/v]<\/pre>\n<p>Which correspond to:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef deffolder -pf credentials.txt -s guiserverhostname -src AllDevFolders.xml \/o<\/pre>\n<\/li>\n<\/ol>\n<h3>updatedef<\/h3>\n<p>The updatedef utility updates specified parameter values in the in the Control-M\/EM database, e.g.:<br \/>\n\t&#8211; Folder definitions<br \/>\n\t&#8211; SMART Folder definitions<br \/>\n\t&#8211; Sub-folder definitions<\/p>\n<p>To run the updatedef utility, you need to specify basic parameters shown before plus the below one:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">-arg &lt;argFileName&gt; &#x5B;\/a]<\/pre>\n<p>        =&gt; -arg : arguments file containing updatedef specifications. The syntax of this xml file is not complex but contain a lot of cases so don&#8217;t hesitate to ask if you have any question!<br \/>\n        =&gt; [\/a]: directs the utility to automatically reset the &#8220;Created By&#8221; parameter to the current Control-M\/EM user when these two values do not match &#8211; OPTIONAL<\/p>\n<p><strong>Example: Modify the Job name of a jobs in APPLICATION_1 and datacenter DC_0:<\/strong><\/p>\n<ol>\n<li>Create an argument file &#8220;UpdateJobs.xml&#8221; like the following:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;UPDATE&gt;\n\t&lt;JOB&gt;\n\t\t&lt;FOLDER_NAME FROM=&quot;APPLICATION_1&quot;\/&gt;\n\t\t\t&lt;DATACENTER FROM=&quot;DC_0&quot;\/&gt;\n\t\t\t&lt;JOBNAME FROM=&quot;src*&quot; TO=&quot;dbi*&quot;\/&gt;\n...<\/pre>\n<\/li>\n<li>Use the same file credentials.txt created before <\/li>\n<li>Execute the command:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef updatedef -pf &lt;passwordFile&gt; -s &lt;guiServerName&gt; -arg &lt;argFileName&gt; &#x5B;\/a]<\/pre>\n<p>Which correspond to:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">emdef updatedef -pf credentials.txt -s guiserverhostname -arg UpdateJobs.xml<\/pre>\n<\/li>\n<\/ol>\n<p>Now you are able to manage folders and calendars using emdef utility, this tool will help you to easily and automatically export, migrate, make bulk update on Control-M definitions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous blog I talked about the emdef utility and how it can help to manage and standardize calendars across multiple environments. In this blog we will deal with folders definitions in the Control-M\/EM database. This can be used to extract data as a backup, or for migration from one to another environment.<\/p>\n","protected":false},"author":46,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1256],"tags":[717,1812],"type_dbi":[],"class_list":["post-13435","post","type-post","status-publish","format-standard","hentry","category-control-m","tag-control-m","tag-utility"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Control-M\/EM - emdef utility - Folders - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Control-M\/EM - emdef utility - Folders\" \/>\n<meta property=\"og:description\" content=\"In a previous blog I talked about the emdef utility and how it can help to manage and standardize calendars across multiple environments. In this blog we will deal with folders definitions in the Control-M\/EM database. This can be used to extract data as a backup, or for migration from one to another environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-10T23:12:05+00:00\" \/>\n<meta name=\"author\" content=\"David Diab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Diab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\"},\"author\":{\"name\":\"David Diab\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/deb907c3360cacdc6c7df54b4bac3c86\"},\"headline\":\"Control-M\/EM &#8211; emdef utility &#8211; Folders\",\"datePublished\":\"2020-02-10T23:12:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\"},\"wordCount\":1035,\"commentCount\":0,\"keywords\":[\"Control-M\",\"utility\"],\"articleSection\":[\"Control-M\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\",\"name\":\"Control-M\/EM - emdef utility - Folders - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2020-02-10T23:12:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/deb907c3360cacdc6c7df54b4bac3c86\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Control-M\/EM &#8211; emdef utility &#8211; Folders\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/deb907c3360cacdc6c7df54b4bac3c86\",\"name\":\"David Diab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/212b1b2e4650bad3116f644ab4fb4663786d94195d7685d0704c8426da088e60?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/212b1b2e4650bad3116f644ab4fb4663786d94195d7685d0704c8426da088e60?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/212b1b2e4650bad3116f644ab4fb4663786d94195d7685d0704c8426da088e60?s=96&d=mm&r=g\",\"caption\":\"David Diab\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/david-diab\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Control-M\/EM - emdef utility - Folders - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/","og_locale":"en_US","og_type":"article","og_title":"Control-M\/EM - emdef utility - Folders","og_description":"In a previous blog I talked about the emdef utility and how it can help to manage and standardize calendars across multiple environments. In this blog we will deal with folders definitions in the Control-M\/EM database. This can be used to extract data as a backup, or for migration from one to another environment.","og_url":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/","og_site_name":"dbi Blog","article_published_time":"2020-02-10T23:12:05+00:00","author":"David Diab","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Diab","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/"},"author":{"name":"David Diab","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/deb907c3360cacdc6c7df54b4bac3c86"},"headline":"Control-M\/EM &#8211; emdef utility &#8211; Folders","datePublished":"2020-02-10T23:12:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/"},"wordCount":1035,"commentCount":0,"keywords":["Control-M","utility"],"articleSection":["Control-M"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/","url":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/","name":"Control-M\/EM - emdef utility - Folders - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2020-02-10T23:12:05+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/deb907c3360cacdc6c7df54b4bac3c86"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/control-m-em-emdef-utility-folders\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Control-M\/EM &#8211; emdef utility &#8211; Folders"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/deb907c3360cacdc6c7df54b4bac3c86","name":"David Diab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/212b1b2e4650bad3116f644ab4fb4663786d94195d7685d0704c8426da088e60?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/212b1b2e4650bad3116f644ab4fb4663786d94195d7685d0704c8426da088e60?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/212b1b2e4650bad3116f644ab4fb4663786d94195d7685d0704c8426da088e60?s=96&d=mm&r=g","caption":"David Diab"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/david-diab\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/13435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=13435"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/13435\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=13435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=13435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=13435"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=13435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}