{"id":224,"date":"2010-12-17T06:43:35","date_gmt":"2010-12-17T06:43:35","guid":{"rendered":"http:\/\/avpsoft.com\/blog\/?p=224"},"modified":"2016-04-14T08:31:52","modified_gmt":"2016-04-14T08:31:52","slug":"apbackup_external_archivers_log","status":"publish","type":"post","link":"https:\/\/avpsoft.com\/blog\/2010\/12\/17\/apbackup_external_archivers_log\/","title":{"rendered":"How to identify the source of an error arising when an APBackup task is executed using an external archiver?"},"content":{"rendered":"<p><a href=\"\/products\/apbackup\/\">APBackup<\/a> allows you to run backup tasks using both the built-in <a href=\"\/blog\/2009\/06\/23\/zip64-backup\/\">Zip64<\/a> archiver and the majority of external archivers. To configure an external archiver for use with APBackup, you need to create\/edit <a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_external_archivers_configuration.htm\">an external archiver configuration file (*.EMC)<\/a>. The APBackup distribution package contains configuration files for the most popular tools: WinRar, WinZip, Arj, 7-Zip, etc. However, you can add a custom configuration file for any other archiver. The process is described in detail in <a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_external_archivers_configuration.htm\">the program documentation<\/a> (where WinRar is used as an example).<\/p>\n<p>When a task is executed using an external archiver, APBackup creates a command line to start it using the information from the corresponding configuration file, creates a process for executing this command line and waits for the process to end. In this case, an archiving task is considered completed if the return code of the created process is 0 and the program finds a newly-created volume after the external archiver has finished working. If the external archiver returns a code different from 0, it means that the task has been completed with an error. Unfortunately, APBackup cannot identify what\u2019s causing the error, as it is related to a different process it has no access to. So what can you do to find the source of the problem?<\/p>\n<p><!--more--><br \/>\nLet\u2019s take a look at an example using <a href=\"http:\/\/www.7-zip.org\/\">7-zip<\/a> and demonstrating how you can obtain more information about an error occurring during the work of an external archiver. This method can be used for any console archiver.<\/p>\n<p>Let\u2019s switch the standard screen output of the archiver to output into a log file for this task.<br \/>\nBelow is the command line executed in our task for the external archiver:<\/p>\n<p><code>\"C:&#92;Program files&#92;7-zip&#92;7z.EXE\" u -t7z -r   -y    \"d:&#92;testRS2&#92;SS101216.7z\" @\"d:&#92;testRS2&#92;SS101216.IFM\"    -mx=5 <\/code><\/p>\n<p>To switch the output of the archiver to a text file, you need to add the following to the end of the line:<\/p>\n<p><code>\"C:&#92;Program files&#92;7-zip&#92;7z.EXE\" u -t7z -r   -y    \"d:&#92;testRS2&#92;SS101216.7z\" @\"d:&#92;testRS2&#92;SS101216.IFM\"    -mx=5 <strong> &gt; \"d:&#92;testRS2&#92;SS101216.7z.7zlog\"<\/strong><\/code><\/p>\n<p>In this case, all messages generated by the archiver will be saved to <strong>&#8220;d:&#92;testRS2&#92;SS101216.7z.7zlog&#8221;<\/strong>. The file has the name of the archive being created. That is, when the external archiver finishes the task, there will be a log file next to it containing any console messages it generated during its work, so you will be able to check what the problem was, if any.<\/p>\n<p>Let\u2019s make it work with APBackup now.<\/p>\n<p>To start off, let\u2019s create a .bat file that we will call instead of 7z.exe. This file, in turn, will call 7zip and pass over the parameters that were first passed to the .bat file itself.<\/p>\n<p><code>7zip.bat<br \/>\n----------------------------------------<br \/>\n\"c:&#92;Program files&#92;7-zip&#92;7z.exe\" %*<\/code><\/p>\n<p>Now, let\u2019s <a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_external_archivers_configuration.htm\">create<\/a> a new configuration file in APBackup based on the file for 7-ZIP (7-Zip.EMC). Use the \u201cPreferences &#8211; Edit Configurations of External Archivers\u201d. Let\u2019s open 7-Zip.EMC and save it under a new name \u2013 like <strong>7ZipWLog.EMC<\/strong>, for instance.<\/p>\n<p style=\"text-align: center;\"><img class=\"aligncenter\" src=\"http:\/\/avpsoft.ru\/blog\/wp-content\/uploads\/2010\/12\/apbackup_backup_using_7Zip.png\" alt=\"\" \/><\/p>\n<p>All we need to do now is to change the command line and the parameters line. Let\u2019s add the path to the previously created <strong>7Zip.bat<\/strong> file to the command line and add the following to the end of the parameters line:<\/p>\n<p><code><br \/>\n&gt; \"[ArchiveName].7zlog\"<br \/>\n<\/code><\/p>\n<p>In this case, when a task is executed, the <strong>[ArchiveName]<\/strong> macros will be replaced with the name of the archive being created.<\/p>\n<p>Once the configuration file has been saved, you need to restart APBackup to enable it to add the new file to the list of external archivers. <\/p>\n<p style=\"text-align: center;\"><img class=\"aligncenter\" src=\"http:\/\/avpsoft.ru\/blog\/wp-content\/uploads\/2010\/12\/apbackup_backup_using_7Zip_task.png\" alt=\"\" \/><\/p>\n<p>From now on, you will be able to <a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_external_archivers.htm\">select an external archiver<\/a> called 7ZipWLog for any task. It will create a log with the name of the created archive and will have the <strong>&#8220;7zlog&#8221;<\/strong> extension.<\/p>\n<p style=\"text-align: center;\"><img class=\"aligncenter\" src=\"http:\/\/avpsoft.ru\/blog\/wp-content\/uploads\/2010\/12\/apbackup_backup_using_7Zip_log.png\" alt=\"\" \/><\/p>\n<p>This method can be used for any archiver supporting the console mode.<\/p>\n<p>Related links<\/p>\n<p><a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_external_archivers.htm\">Using external archivers in APBackup<\/a><br \/>\n<a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_external_archivers_configuration.htm\">Configuring external archivers in APBackup<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>APBackup allows you to run backup tasks using both the built-in Zip64 archiver and the majority of external archivers. To configure an external archiver for use with APBackup, you need to create\/edit an external archiver configuration file (*.EMC). The APBackup distribution package contains configuration files for the most popular tools: WinRar, WinZip, Arj, 7-Zip, etc. &#8230;<\/p>\n<p><a href=\"https:\/\/avpsoft.com\/blog\/2010\/12\/17\/apbackup_external_archivers_log\/\" class=\"more-link\">Continue reading &lsquo;How to identify the source of an error arising when an APBackup task is executed using an external archiver?&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[24,12,14],"_links":{"self":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/224"}],"collection":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":3,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/224\/revisions\/355"}],"wp:attachment":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}