{"id":738,"date":"2011-11-10T17:42:27","date_gmt":"2011-11-10T15:42:27","guid":{"rendered":"http:\/\/www.netexpertise.eu\/en\/?p=738"},"modified":"2021-10-10T19:26:08","modified_gmt":"2021-10-10T17:26:08","slug":"delete-b2d-dbackup-exec-files","status":"publish","type":"post","link":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html","title":{"rendered":"Delete Backup Exec B2D Files"},"content":{"rendered":"\n<p>Here&#8217;s a script that deletes all the Backup Exec B2D files part of a media set. Stick the following script into a .bat file and edit the first 3 settings Mediaset, B2Dfolder and BEPath.<br>You can run it straight.<br>&nbsp;<br>I consider it is good practice to do for the following reasons:<br>&#8211; You can of course set the overwrite protection and Backup Exec reuses the BKF files when they&#8217;re no longer needed. This system works pretty well in most cases especially if there&#8217;s plenty of space on the disk. If a backup is delayed and you run out of space, the next backup will be delayed until the first times out.<br>&#8211; I&#8217;ve seen enough people on forums getting bad restore or duplication speed due to a high disk fragmentation. This is no more an issue when files get deleted.<br>&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">@Echo Off\n::\n:: Deletes Backup Exec BKF files.\n::\n\n:CONFIGURE\n SETLOCAL\n::\n:: Edit the following 3 items below to match your installation.\n::\n:: * MediaSet - the Backup Exec Media Set Name you are using for backup-to-disk jobs \n::   Works with spaces\n:: * B2Dfolder - the full path to the backup-to-disk folder you are using for the job\n:: * BEPath - the full path to the Backup Exec executables (specifically, bemcmd.exe).\n::   (If you did not change it, this is C:\\Program Files\\Symantec\\Backup Exec\\bemcmd.exe, \n::   on US English systems)\n\n SET MediaSet=\"Disk Media\"\n SET B2Dfolder=S:\\Backup\\\n SET BEPath=\"C:\\Program Files\\Symantec\\Backup Exec\\bemcmd.exe\"\n\n IF NOT EXIST %BEPath% ECHO Cannot find the path to Backup Exec!^\n Please edit the command script. ^\n &amp;&amp; goto End\n\n:: Get Media Set Id from Media Set Name\n:: Works with white spaces\n\n FOR \/F \"tokens=3\" %%m IN ('\"%BEPath% -o70 -j%MediaSet%\" ^| FINDSTR ^{[-0-9A-F]*}\n) do (\n   SET MediaSetId=%%m\n )\n\n:: Retired Media Set Id: identical on all systems\n SET RetiredMediaSetId={00000009-0002-0000-0000-000000000000}\n\n:MAIN\n::\n:: First, dump a list of all the media labels Backup Exec is currently using.\n:: Move them to the retired media set\n:: and deletes them in Backup Exec and physically on the disk\n::\n\n FOR \/F \"tokens=3\" %%m IN ('\"%BEPath%\" -o132 -i%MediaSetId% ^| FINDSTR ^B2D[0-9]*\n) do (\n  ECHO Processing %%m...\n  :: Move media to Retired Medias\n  %BEPath% -o130 -j%%m -ms:%RetiredMediaSetId% &gt; NUL\n  :: Delete media from Backup Exec\n  %BEPath% -o129 -m%%m &gt; NUL\n  :: Delete media from filesystem\n  IF EXIST %B2Dfolder%%%m.bkf DEL %B2Dfolder%%%m.bkf\n )\n\n:END\nENDLOCAL<\/code><\/pre>\n\n\n\n<p>&nbsp;<br>Note: The script should be scheduled in the Windows Scheduled Tasks. Don&#8217;t launch it from a Backup Exec pre-job script, it will not run. Only a limited number of bemcmd operations can be performed in a <a href=\"http:\/\/www.symantec.com\/business\/support\/index?page=content&amp;id=TECH34319\">pre-job script<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a script that deletes all the Backup Exec B2D files part of a media set. Stick the following script into a .bat file and edit the first 3 settings Mediaset, B2Dfolder and BEPath.You can run it straight.&nbsp;I consider it is good practice to do for the following reasons:&#8211; You can of course set the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[319],"tags":[58],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Netexpertise - Delete Backup Exec B2D Files<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Netexpertise - Delete Backup Exec B2D Files\" \/>\n<meta property=\"og:description\" content=\"Here&#8217;s a script that deletes all the Backup Exec B2D files part of a media set. Stick the following script into a .bat file and edit the first 3 settings Mediaset, B2Dfolder and BEPath.You can run it straight.&nbsp;I consider it is good practice to do for the following reasons:&#8211; You can of course set the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html\" \/>\n<meta property=\"og:site_name\" content=\"Netexpertise\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-10T15:42:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-10T17:26:08+00:00\" \/>\n<meta name=\"author\" content=\"dave\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@netexpertise\" \/>\n<meta name=\"twitter:site\" content=\"@netexpertise\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html\",\"url\":\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html\",\"name\":\"Netexpertise - Delete Backup Exec B2D Files\",\"isPartOf\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#website\"},\"datePublished\":\"2011-11-10T15:42:27+00:00\",\"dateModified\":\"2021-10-10T17:26:08+00:00\",\"author\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\"},\"breadcrumb\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.netexpertise.eu\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Delete Backup Exec B2D Files\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#website\",\"url\":\"http:\/\/www.netexpertise.eu\/en\/\",\"name\":\"Netexpertise\",\"description\":\"Systems \/ Networks \/ DevOps\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.netexpertise.eu\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\",\"name\":\"dave\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"caption\":\"dave\"},\"sameAs\":[\"http:\/\/www.netexpertise.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Netexpertise - Delete Backup Exec B2D Files","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":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html","og_locale":"en_US","og_type":"article","og_title":"Netexpertise - Delete Backup Exec B2D Files","og_description":"Here&#8217;s a script that deletes all the Backup Exec B2D files part of a media set. Stick the following script into a .bat file and edit the first 3 settings Mediaset, B2Dfolder and BEPath.You can run it straight.&nbsp;I consider it is good practice to do for the following reasons:&#8211; You can of course set the [&hellip;]","og_url":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html","og_site_name":"Netexpertise","article_published_time":"2011-11-10T15:42:27+00:00","article_modified_time":"2021-10-10T17:26:08+00:00","author":"dave","twitter_card":"summary_large_image","twitter_creator":"@netexpertise","twitter_site":"@netexpertise","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html","url":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html","name":"Netexpertise - Delete Backup Exec B2D Files","isPartOf":{"@id":"http:\/\/www.netexpertise.eu\/en\/#website"},"datePublished":"2011-11-10T15:42:27+00:00","dateModified":"2021-10-10T17:26:08+00:00","author":{"@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa"},"breadcrumb":{"@id":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.netexpertise.eu\/en\/systems\/backup\/delete-b2d-dbackup-exec-files.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.netexpertise.eu\/en"},{"@type":"ListItem","position":2,"name":"Delete Backup Exec B2D Files"}]},{"@type":"WebSite","@id":"http:\/\/www.netexpertise.eu\/en\/#website","url":"http:\/\/www.netexpertise.eu\/en\/","name":"Netexpertise","description":"Systems \/ Networks \/ DevOps","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.netexpertise.eu\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa","name":"dave","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","caption":"dave"},"sameAs":["http:\/\/www.netexpertise.eu"]}]}},"_links":{"self":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/738"}],"collection":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/comments?post=738"}],"version-history":[{"count":0,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/738\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/media?parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/categories?post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/tags?post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}