{"id":13419222,"url":"https://github.com/Parchive/par2cmdline","last_synced_at":"2025-03-15T05:30:30.641Z","repository":{"id":1952449,"uuid":"2882490","full_name":"Parchive/par2cmdline","owner":"Parchive","description":"Official repo for par2cmdline and libpar2","archived":false,"fork":false,"pushed_at":"2024-03-12T15:11:11.000Z","size":5599,"stargazers_count":676,"open_issues_count":54,"forks_count":70,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-04-26T09:20:48.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://parchive.sourceforge.net","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Parchive.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP","authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-30T11:16:04.000Z","updated_at":"2024-06-18T23:39:19.983Z","dependencies_parsed_at":"2023-07-06T17:01:24.463Z","dependency_job_id":"2da10cd4-9240-45ba-b827-034fb6433963","html_url":"https://github.com/Parchive/par2cmdline","commit_stats":{"total_commits":483,"total_committers":31,"mean_commits":"15.580645161290322","dds":0.577639751552795,"last_synced_commit":"0b266b5d41669fc1977f327c5d7e422b1ef06ac8"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Parchive%2Fpar2cmdline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Parchive%2Fpar2cmdline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Parchive%2Fpar2cmdline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Parchive%2Fpar2cmdline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Parchive","download_url":"https://codeload.github.com/Parchive/par2cmdline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690115,"owners_count":20331725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:12.986Z","updated_at":"2025-03-15T05:30:30.063Z","avatar_url":"https://github.com/Parchive.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","C++","\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","Long-term data archiving"],"sub_categories":["Download automation"],"readme":"par2cmdline is a PAR 2.0 compatible file verification and repair tool.\n\nTo see the ongoing development see:\nhttps://github.com/parchive/par2cmdline\n\nOpenMP multithreading was originally developed by Jussi Kansanen:\nhttps://github.com/jkansanen/par2cmdline-mt\n\nThe original development was done on Sourceforge but stalled.\nFor more information from the original authors see\nhttp://parchive.sourceforge.net\nAlso for details of the PAR 2.0 specification and discussion of all\nthings PAR.\n\nWHAT EXACTLY IS PAR2CMDLINE?\n\npar2cmdline is a program for creating and using PAR2 files to detect\ndamage in data files and repair them if necessary. It can be used with\nany kind of file.\n\nWHY IS PAR 2.0 better than PAR 1.0?\n\n * It is not necessary to split a single large file into many equal-sized\n   small files (although you can still do so if you wish).\n\n * There is no loss of efficiency when operating on multiple files\n   of different sizes.\n\n * It is possible to repair damaged files (using exactly the amount of\n   recovery data that corresponds to the amount of damage), rather than\n   requiring the complete reconstruction of the damaged file.\n\n * Recovery files may be of different sizes making it possible to\n   obtain exactly the amount of recovery data required to carry out\n   a repair.\n\n * Because damaged data files are still useable during the recovery\n   process, less recovery data is required to achieve a successful\n   repair. It is therefore not necessary to create as much recovery\n   data in the first place to achieve the same level of protection.\n\n * You can protect up to 32768 files rather than the 256 that PAR 1.0\n   is limited to.\n\n * Damaged or incomplete recovery files can also be used during the\n   recovery process in the same way that damaged data files can.\n\n * PAR 2.0 requires less recovery data to provide the same level of\n   protection from damage compared with PAR 1.0.\n\nDOES PAR 2.0 HAVE ANY DISADVANTAGES?\n\nYes, there is one disadvantage:\n\n * All PAR 2.0 program will take somewhat longer to create recovery\n   files than a PAR 1.0 program does.\n\nThis disadvantage is considerably mitigated by the fact that you don't\nneed to create as much recovery data in the first place to provide the\nsame level of protection against loss and damage.\n\nCOMPILING PAR2CMDLINE\n\nYou should have received par2cmdline in the form of source code which\nyou can compile on your computer. You may optionally have received a\nprecompiled version of the program for your operating system.\n\nIf you have only downloaded a precompiled executable, then the source\ncode should be available from the same location where you downloaded the\nexecutable from.\n\nIf you have MS Visual Studio .NET, then just open the par2cmdline.sln\nfile and compile. You should then copy par2cmdline.exe to an appropriate\nlocation that is on your path.\n\nTo compile on Linux and other Unix variants use the following commands:\n\n  ./automake.sh\n  ./configure\n  make\n  make check\n  make install\n\nFor FreeBSD you must install the following dependencies:\n\n    pkg install git automake openmp\n\nOpenMP will only be available for 64bit systems in FreeBSD.\n\nFor macOS you can install llvm via homebrew to get OpenMP support.\n\nSee INSTALL for full details on how to use the \"configure\" script.\n\nUSING PAR2CMDLINE\n\nThe command line parameters for par2cmdline are as follow:\n\n    par2 -h  : show this help\n    par2 -V  : show version\n    par2 -VV : show version and copyright\n\n    par2 c(reate) [options] \u003cPAR2 file\u003e [files]\n    par2 v(erify) [options] \u003cPAR2 file\u003e [files]\n    par2 r(epair) [options] \u003cPAR2 file\u003e [files]\n\n  Also:\n\n    par2create [options] \u003cPAR2 file\u003e [files]\n    par2verify [options] \u003cPAR2 file\u003e [files]\n    par2repair [options] \u003cPAR2 file\u003e [files]\n\n  Options:\n\n    -a\u003cfile\u003e : Set the main PAR2 archive name\n               required on create, optional for verify and repair\n    -b\u003cn\u003e    : Set the Block-Count\n    -s\u003cn\u003e    : Set the Block-Size (don't use both -b and -s)\n    -r\u003cn\u003e    : Level of redundancy (%)\n    -r\u003cc\u003e\u003cn\u003e : Redundancy target size, \u003cc\u003e=g(iga),m(ega),k(ilo) bytes\n    -c\u003cn\u003e    : Recovery block count (don't use both -r and -c)\n    -f\u003cn\u003e    : First Recovery-Block-Number\n    -u       : Uniform recovery file sizes\n    -l       : Limit size of recovery files (don't use both -u and -l)\n    -n\u003cn\u003e    : Number of recovery files (don't use both -n and -l)\n    -m\u003cn\u003e    : Memory (in MB) to use\n    -t\u003cn\u003e    : Number of threads to use (Auto-detected)\n    -v [-v]  : Be more verbose\n    -q [-q]  : Be more quiet (-qq gives silence)\n    -p       : Purge backup files and par files on successful recovery or\n               when no recovery is needed\n    -R       : Recurse into subdirectories (only useful on create)\n    -N       : data skipping (find badly mispositioned data blocks)\n    -S\u003cn\u003e    : Skip leaway (distance +/- from expected block position)\n    -B\u003cpath\u003e : Set the basepath to use as reference for the datafiles\n    --       : Treat all following arguments as filenames\n\nIf you wish to create PAR2 files for a single source file, you may leave\nout the name of the PAR2 file from the command line. par2cmdline will then\nassume that you wish to base the filenames for the PAR2 files on the name\nof the source file.\n\nYou may also leave off the .par2 file extension when verifying and repairing.\n\nCREATING PAR2 FILES\n\nWith PAR 2.0 you can create PAR2 recovery files for as few as 1 or as many as\n32768 files. If you wanted to create PAR1 recovery files for a single file\nyou were forced to split the file into muliple parts and RAR was frequently\nused for this purpose. You do NOT need to split files with PAR 2.0.\n\nTo create PAR 2 recovery files for a single data file (e.g. one called\ntest.mpg), you can use the following command:\n\n  par2 create test.mpg.par2 test.mpg\n\nIf test.mpg is an 800 MB file, then this will create a total of 8 PAR2 files\nwith the following filenames (taking roughly 6 minutes on a PC with a\n1500 MHz CPU):\n\n  test.mpg.par2          - This is an index file for verification only\n  test.mpg.vol00+01.par2 - Recovery file with 1 recovery block\n  test.mpg.vol01+02.par2 - Recovery file with 2 recovery blocks\n  test.mpg.vol03+04.par2 - Recovery file with 4 recovery blocks\n  test.mpg.vol07+08.par2 - Recovery file with 8 recovery blocks\n  test.mpg.vol15+16.par2 - Recovery file with 16 recovery blocks\n  test.mpg.vol31+32.par2 - Recovery file with 32 recovery blocks\n  test.mpg.vol63+37.par2 - Recovery file with 37 recovery blocks\n\nThe test.mpg.par2 file is 39 KB in size and the other files vary in size from\n443 KB to 15 MB.\n\nThese PAR2 files will enable the recovery of up to 100 errors totalling 40 MB\nof lost or damaged data from the original test.mpg file when it and the PAR2\nfiles are posted on UseNet.\n\nWhen posting on UseNet it is recommended that you use the \"-s\" option to set\na blocksize that is equal to the Article size that you will use to post the\ndata file. If you wanted to post the test.mpg file using an article size\nof 300 KB then the command you would type is:\n\n  par2 create -s307200 test.mpg.par2 test.mpg\n\nThis will create 9 PAR2 files instead of 8, and they will be capable of\ncorrecting up to 134 errors totalling 40 MB. It will take roughly 8 minutes\nto create the recovery files this time.\n\nIn both of these two examples, the total quantity of recovery data created\nwas 40 MB (which is 5% of 800 MB). If you wish to create a greater or lesser\nquantity of recovery data, you can use the \"-r\" option.\n\nTo create 10% recovery data instead of the default of 5% and also to use a\nblock size of 300 KB, you would use the following command:\n\n  par2 create -s307200 -r10 test.mpg.par2 test.mpg\n\nThis would also create 9 PAR2 files, but they would be able to correct up to\n269 errors totalling 80 MB. Since twice as much recovery data is created, it\nwill take about 16 minutes to do so with a 1500 MHz CPU.\n\nThe \"-u\" and \"-n\" options can be used to control exactly how many recovery\nfiles are created and how the recovery blocks are distributed among them.\nThey do not affect the total quantity of recovery data created.\n\nThe \"-f\" option is used when you create additional recovery data e.g. If\nyou have already created 10% and want another 5% then you might use the\nfollowing command:\n\n  par2 create -s307200 -r5 -f300 test.mpg.par2 test.mpg\n\nThis specifies the same block size (which is a requirement for additional\nrecovery files), 5% recovery data, and a first block number of 300.\n\nThe \"-m\" option controls how much memory par2cmdline uses. It defaults to\n16 MB unless you override it.\n\nWhen creating PAR2 recovery files you might want to fill up a storage medium\nlike a DVD or a Blu-Ray. Therefore we can set the target size of the recovery\nfiles by issuing the following command:\n\n  par2 create -rm200 recovery.par2 *\n\nIt makes no sense to set an insanely high recovery size. The command will make\nthat the resulting sum of the PAR2 files approaches the requested size. It is\nan estimate so don't go too crazy.\n\nCREATING PAR2 FILES FOR MULTIPLE DATA FILES\n\nWhen creating PAR2 recovery files from multiple data files, you must specify\nthe base filename to use for the PAR2 files and the names of all of the data\nfiles.\n\nIf test.mpg had been split into multiple RAR files, then you could use:\n\n  par2 create test.mpg.rar.par2 test.mpg.part*.rar\n\nThe filename \"test.mpg.rar.par2\" states what you want the PAR2 files to\nbe called and \"test.mpg.part*.rar\" should select all of the RAR files.\n\nVERIFYING AND REPAIRING\n\nWhen using PAR2 recovery files to verify or repair the data files from\nwhich they were created, you only need to specify the filename of one\nof the PAR2 files to par2cmdline:\n\n  par2 verify test.mpg.par2\n\nThis tells par2cmdline to use the information in test.mpg.par2 to verify the\ndata files.\n\npar2cmdline will automatically search for the other PAR2 files that were\ncreated and use the information they contain to determine the filenames\nof the original data files and then to verify them.\n\nIf all of the data files are OK, then par2cmdline will report that repair\nwill not be required.\n\nIf any of the data files are missing or damaged, par2cmdline will report\nthe details of what it has found. If the recovery files contain enough\nrecovery blocks to repair the damage, you will be told that repair is\npossible. Otherwise you will be told exactly how many recovery blocks\nwill be required in order to repair.\n\nTo carry out a repair use the following command:\n\n  par2 repair test.mpg.par2\n\nThis tells par2cmdline to verify and if possible repair any damaged or\nmissing files. If a repair is carried out, then each file which is\nrepaired will be re-verified to confirm that the repair was successful.\n\nMISNAMED AND INCOMPLETE DATA FILES\n\nIf any of the recovery files or data files have the wrong filename, then\npar2cmdline will not automatically find and scan them.\n\nTo have par2cmdline scan such files, you must include them on the command\nline when attempting to verify or repair.\n\ne.g.:\n\n  par2 r test.mpg.par2 other.mpg\n\nThis tells par2cmdline to scan the file called other.mpg to see if it\ncontains any data belonging to the original data files.\n\nIf one of the extra files specified in this way is an exact match\nfor a data file, then the repair process will rename the file so that\nit has the correct filename.\n\nBecause par2cmdline is designed to be able to find good data within a\ndamaged file, it can do the same with incomplete files downloaded from\nUseNet. If some of the articles for a file are missing, you should still\ndownload the file and save it to disk for par2cmdline to scan. If you\ndo this then you may find that you can carry out a repair in a situation\nwhere you would not otherwise have sufficient recovery data.\n\nYou can have par2cmdline scan all files that are in the current directory\nusing a command such as:\n\n  par2 r test.mpg.par2 *\n\nWHAT TO DO WHEN YOU ARE TOLD YOU NEED MORE RECOVERY BLOCKS\n\nIf par2cmdline determines that any of the data files are damaged or\nmissing and finds that there is insufficient recovery data to effect\na repair, you will be told that you need a certain number of recovery\nblocks. You can obtain these by downloading additional recovery files.\n\nIn order to make things easy, PAR2 files have filenames that tell you\nexactly how many recovery blocks each one contains.\n\nAssuming that the following command was used to create recovery data:\n\n  par2 c -b1000 -r5 test.mpg\n\nThen the recovery files that are created would be called:\n\n  test.mpg.par2\n  test.mpg.vol00+01.par2\n  test.mpg.vol01+02.par2\n  test.mpg.vol03+04.par2\n  test.mpg.vol07+08.par2\n  test.mpg.vol15+16.par2\n  test.mpg.vol31+19.par2\n\nThe first file in this list does not contain any recovery data, it only\ncontains information to verify the data files.\n\nEach of the other files contains a different number of recovery blocks.\nThe number after the '+' sign is the number of recovery blocks and the\nnumber preceding the '+' sign is the block number of the first recovery\nblock in that file.\n\nIf par2cmdline told you that you needed 10 recovery blocks, then you would\nneed \"test.mpg.vol01+02.par2\" and \"test.mpg.vol07+08.par\". You might of course\nchoose to fetch \"test.mpg.vol15+16.par2\" instead (in which case you would have\nan extra 6 recovery blocks which would not be used for the repair).\n\nREED-SOLOMON CODING\n\nPAR2 uses Reed-Solomon Coding to perform its calculations. For details of this\ncoding technique try the following link:\n\n``A Tutorial on Reed-Solomon Coding for Fault-Tolerance in RAID-like Systems''\n\u003chttp://web.eecs.utk.edu/~plank/plank/papers/CS-96-332.html\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParchive%2Fpar2cmdline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FParchive%2Fpar2cmdline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParchive%2Fpar2cmdline/lists"}