{"id":237,"date":"2011-01-12T10:03:21","date_gmt":"2011-01-12T10:03:21","guid":{"rendered":"http:\/\/avpsoft.com\/blog\/?p=237"},"modified":"2016-04-14T08:27:50","modified_gmt":"2016-04-14T08:27:50","slug":"backup_long_file_path_issue","status":"publish","type":"post","link":"https:\/\/avpsoft.com\/blog\/2011\/01\/12\/backup_long_file_path_issue\/","title":{"rendered":"The problem of long paths in backups (Copy mode in APBackup)."},"content":{"rendered":"<p>In Windows, the maximum length of a file name <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa365247(VS.85).aspx#maxpath\">is defined<\/a> as MAX_PATH = 260 characters. In the <a href=\"\/products\/apbackup\/\">APBackup<\/a> copy mode, however, the resulting length of an archived file can exceed this limit &#8211; and this can cause a problem. <!--more--><\/p>\n<p style=\"text-align: center;\"><img class=\"aligncenter\" src=\"\/blog\/wp-content\/uploads\/2011\/01\/backup_long_file_path_copy_mode.png\" alt=\"Backup copy mode\" \/><\/p>\n<p>In this case, the APBackup task will be terminated with one of the following errors:<\/p>\n<p><code>Can not create destination file: [EID:3:Path not found...<br \/>\nCan not create destination file: [EID:206:The filename or extension is too long:...<br \/>\nCan not create destination file: [EID:3:The filename or extension is too long:...<br \/>\n<\/code><\/p>\n<p>For instance, a task copies folder <strong>C:&#92;Documents and Settings&#92;User&#92;*.*<\/strong><br \/>\nto a backup archive called <strong>D:&#92;Backup&#92;Backup_2011&#92;Daily_Backups&#92;January&#92;Profile<\/strong><br \/>\nIn this case, a source file with a name slightly shorter than 260 characters &#8211; <strong>&#8220;C:&#92;Documents and Settings&#92;User[210_symbols_path]example.txt&#8221;<\/strong> \u2013 will be copied to a file called <strong>&#8220;D:&#92;Backup&#92;Backup_2011&#92;Daily_Backups&#92;January&#92;Profile&#92;Documents and Settings&#92;User[210_symbols_path]example.txt&#8221;<\/strong> and its final length will exceed 260 characters. This APBackup task will be terminated with an error.<\/p>\n<p>There are several ways to avoid this situation:<\/p>\n<p>1. Sometimes it turns out that files with such long names in the source location are not needed. For instance, these can be various temporary or cache files. In this case, termination of the task because of such a file is highly undesirable or the archive must be created regardless of these problems and even if some files are lost in the process.<br \/>\nFor such cases, APBackup has a special option on the <strong>[Source]<\/strong> tab: <strong>&#8220;Skip files with too long destination name&#8221;<\/strong>.<\/p>\n<p style=\"text-align: center;\"><img class=\"aligncenter\" src=\"\/blog\/wp-content\/uploads\/2011\/01\/backup_long_file_path_skip_files.png\" alt=\"\" \/><\/p>\n<p>If you enable this option and a long path situation takes place, APBackup will add a warning with the name of the source file to the log, will skip this file and will resume the execution of the task. In this case, the task will be completed and the names of skipped files will be written to the APBackup log. By the way, APBackup <a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_notifications.htm\">can email the log<\/a> for a specific task to the admin after the completion of the task.<\/p>\n<p>2. Another method is to shorten the path to the resulting file in the destination folder. You can shorten the archive path \u2013 in this example, shorten the &#8220;<strong>D:&#92;Backup&#92;Backup_2011&#92;Daily_Backups&#92;January&#92;Profile<\/strong>&#8221; path.  You can also uncheck the <strong>&#8220;Store full source path on copy&#8221;<\/strong> option on the <strong>[Source]<\/strong> tab.<\/p>\n<p style=\"text-align: center;\"><img class=\"aligncenter\" src=\"\/blog\/wp-content\/uploads\/2011\/01\/backup_long_file_path_store_full_source_path.png\" alt=\"\" \/><\/p>\n<p>If this option is enabled, the full path to the source file will be saved, starting from the root of the drive.<br \/>\nIn our case, the following will be saved: <strong>&#8220;Documents and Settings&#92;User&#8221;<\/strong>:<\/p>\n<p><code>D:&#92;Backup&#92;Backup_2011&#92;Daily_Backups&#92;January&#92;Profile&#92;Documents and Settings&#92;User[210_symbols_path]example.txt<\/code><\/p>\n<p>If you enable this option, the path will be saved only from the source folder \u2013 that is, the <strong>&#8220;Documents and Settings&#92;User&#8221;<\/strong> part of the file name will not be saved.<\/p>\n<p><code>D:&#92;Backup&#92;Backup_2011&#92;Daily_Backups&#92;January&#92;Profile&#92;[210 symbols path]example.txt<br \/>\n<\/code><\/p>\n<p>This is how you can use the second method to nearly completely exclude the possibility of an error arising during task execution. If the second method doesn\u2019t work for some reason, use the option that allows skipping files with long names without stopping the execution of the task.<\/p>\n<p>Related links:<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa365247(VS.85).aspx#maxpath\">MSDN: Maximum Path Length Limitation<\/a><br \/>\n<a href=\"\/products\/apbackup\/apbackup_knowledge_base\/apbackup_tatsk_configuration.htm\">APBackup: backup creation modes.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Windows, the maximum length of a file name is defined as MAX_PATH = 260 characters. In the APBackup copy mode, however, the resulting length of an archived file can exceed this limit &#8211; and this can cause a problem.<\/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,13,14],"_links":{"self":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/237"}],"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=237"}],"version-history":[{"count":2,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":352,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/237\/revisions\/352"}],"wp:attachment":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}