tarsnap.1-man.in 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469
  1. .TH TARSNAP 1 "@DATE@" ""
  2. .SH NAME
  3. .ad l
  4. \fB\%tarsnap\fP
  5. \- manipulate remote encrypted backups
  6. .SH SYNOPSIS
  7. .ad l
  8. .br
  9. \fB\%tarsnap\fP
  10. {\fB\-c\fP}
  11. \fB\--keyfile\fP \fIkey-file\fP
  12. \fB\--cachedir\fP \fIcache-dir\fP
  13. \fB\-f\fP \fIarchive-name\fP
  14. [\fIoptions\fP]
  15. [\fIfiles\fP | \fIdirectories\fP]
  16. .br
  17. \fB\%tarsnap\fP
  18. {\fB\-d\fP}
  19. \fB\--keyfile\fP \fIkey-file\fP
  20. \fB\--cachedir\fP \fIcache-dir\fP
  21. \fB\-f\fP \fIarchive-name\fP
  22. [\fIoptions\fP]
  23. .br
  24. \fB\%tarsnap\fP
  25. {\fB\-t\fP | \fB\-x\fP}
  26. \fB\--keyfile\fP \fIkey-file\fP
  27. \fB\-f\fP \fIarchive-name\fP
  28. [\fIoptions\fP]
  29. [\fIpatterns\fP]
  30. .br
  31. \fB\%tarsnap\fP
  32. {\fB\-r\fP}
  33. \fB\--keyfile\fP \fIkey-file\fP
  34. \fB\-f\fP \fIarchive-name\fP
  35. .br
  36. \fB\%tarsnap\fP
  37. {\fB\--list-archives\fP}
  38. \fB\--keyfile\fP \fIkey-file\fP
  39. .br
  40. \fB\%tarsnap\fP
  41. {\fB\--print-stats\fP}
  42. \fB\--keyfile\fP \fIkey-file\fP
  43. \fB\--cachedir\fP \fIcache-dir\fP
  44. [\fB\-f\fP \fIarchive-name\fP]
  45. .br
  46. \fB\%tarsnap\fP
  47. {\fB\--recover\fP}
  48. \fB\--keyfile\fP \fIkey-file\fP
  49. \fB\--cachedir\fP \fIcache-dir\fP
  50. .br
  51. \fB\%tarsnap\fP
  52. {\fB\--fsck\fP}
  53. \fB\--keyfile\fP \fIkey-file\fP
  54. \fB\--cachedir\fP \fIcache-dir\fP
  55. .br
  56. \fB\%tarsnap\fP
  57. {\fB\--fsck-prune\fP}
  58. \fB\--keyfile\fP \fIkey-file\fP
  59. \fB\--cachedir\fP \fIcache-dir\fP
  60. .br
  61. \fB\%tarsnap\fP
  62. {\fB\--initialize-cachedir\fP}
  63. \fB\--keyfile\fP \fIkey-file\fP
  64. \fB\--cachedir\fP \fIcache-dir\fP
  65. .br
  66. \fB\%tarsnap\fP
  67. {\fB\--nuke\fP}
  68. \fB\--keyfile\fP \fIkey-file\fP
  69. .br
  70. \fB\%tarsnap\fP
  71. \fB\--verify-config\fP
  72. .br
  73. \fB\%tarsnap\fP
  74. \fB\--version\fP
  75. .SH DESCRIPTION
  76. .ad l
  77. \fB\%tarsnap\fP
  78. creates, reads, deletes, and otherwise manages online backups.
  79. .PP
  80. The first option to
  81. \fB\%tarsnap\fP
  82. is a mode indicator from the following list:
  83. .RS 5
  84. .TP
  85. \fB\-c\fP
  86. Create an archive containing the specified items and name.
  87. .TP
  88. \fB\-d\fP
  89. Delete the specified archive.
  90. .TP
  91. \fB\-t\fP
  92. List archive contents to stdout.
  93. .TP
  94. \fB\-x\fP
  95. Extract to disk from the archive.
  96. .TP
  97. \fB\-r\fP
  98. Read the specified archive, convert it to a tar stream, and write it
  99. to stdout.
  100. .TP
  101. \fB\--list-archives\fP
  102. Print the names of archives stored.
  103. If the
  104. \fB\-v\fP
  105. flag is specified one or more times, the creation
  106. time of each archive is also printed;
  107. if the
  108. \fB\-v\fP
  109. flag is specified two or more times, the command
  110. line with which
  111. \fB\%tarsnap\fP
  112. was invoked to create each archive is also printed.
  113. .TP
  114. \fB\--print-stats\fP
  115. Print global statistics concerning the archives stored, and optionally
  116. information about individual archive(s).
  117. See "PRINTING ARCHIVE STATISTICS" below for information on the output format.
  118. .TP
  119. \fB\--recover\fP
  120. Recover a partial archive from a checkpoint if such an archive exists.
  121. This is also done automatically the next time an archive is created
  122. or deleted.
  123. .TP
  124. \fB\--fsck\fP
  125. Perform some integrity checks on the archives stored, and reconstruct the
  126. cache directory
  127. \fIcache-dir\fP.
  128. In the unlikely event that there are corrupted archives,
  129. \fB\%tarsnap\fP
  130. will exit and request that it be run with the
  131. \fB\--fsck-prune\fP
  132. option.
  133. .TP
  134. \fB\--fsck-prune\fP
  135. Run as
  136. \fB\--fsck\fP,
  137. but if corrupt archives are detected, prune the broken data.
  138. .TP
  139. \fB\--initialize-cachedir\fP
  140. Create and initialize the cachedir.
  141. This option is intended for the GUI and is not needed for command-line usage.
  142. .TP
  143. \fB\--nuke\fP
  144. Delete all of the archives stored.
  145. To protect against accidental data loss,
  146. \fB\%tarsnap\fP
  147. will ask you to type the text "No Tomorrow" when using the
  148. \fB\--nuke\fP
  149. command.
  150. .TP
  151. \fB\--verify-config\fP
  152. Check the configuration file(s) for syntactic errors.
  153. .TP
  154. \fB\--version\fP
  155. Print version number of
  156. \fB\%tarsnap\fP,
  157. and exit.
  158. .RE
  159. .PP
  160. In
  161. \fB\-c\fP
  162. mode, each specified file or directory is added to the
  163. archive in the order specified on the command line.
  164. By default, the contents of each directory are also archived.
  165. .PP
  166. In
  167. \fB\-t\fP
  168. or
  169. \fB\-x\fP
  170. mode, the entire command line
  171. is read and parsed before the archive is opened.
  172. The pathnames or patterns on the command line indicate
  173. which items in the archive should be processed.
  174. Patterns are shell-style globbing patterns as
  175. documented in
  176. \fBtcsh\fP(1).
  177. Note that these follow the POSIX rules for pattern matching, e.g.,
  178. `[]'
  179. are special characters which can be escaped with a backslash.
  180. .PP
  181. Two concurrent create or delete operations may not be performed with the same
  182. key.
  183. Extracting or listing archives may be performed in parallel with any other
  184. operation.
  185. .SH OPTIONS
  186. .ad l
  187. .RS 5
  188. .TP
  189. \fB@\fP\fIarchive-file\fP
  190. (c mode only)
  191. The specified archive file is read and the entries
  192. in it will be appended to the current archive.
  193. If
  194. \fIarchive-file\fP
  195. is
  196. ``-''
  197. then the archive will be read from the standard input.
  198. As an example,
  199. .RS 4
  200. \fB\%tarsnap\fP \fB\-c\fP \fB\--keyfile\fP \fIkey-file\fP \fB\--cachedir\fP \fIcache-dir\fP \fB\-f\fP \fImybackup\fP \fB@\fP\fIbackup.tar\fP
  201. .RE
  202. reads the archive file
  203. \fIbackup.tar\fP
  204. from disk and stores it using
  205. \fB\%tarsnap\fP.
  206. .TP
  207. \fB@@\fP\fIarchive-name\fP
  208. (c mode only)
  209. The specified
  210. \fB\%tarsnap\fP
  211. archive is read and the entries in it will be
  212. appended to the current archive.
  213. .TP
  214. \fB\--aggressive-networking\fP
  215. (c mode only)
  216. Use multiple TCP connections to send data to the
  217. \fB\%tarsnap\fP
  218. server.
  219. If the upload rate is congestion-limited rather than
  220. being limited by individual bottleneck(s), this may
  221. allow tarsnap to use a significantly larger fraction
  222. of the available bandwidth, at the expense of slowing
  223. down any other network traffic.
  224. .TP
  225. \fB\--archive-names\fP \fIfilename\fP
  226. Read a list of archive names from
  227. \fIfilename\fP.
  228. .TP
  229. \fB\-C\fP \fIdirectory\fP
  230. (c and x modes only)
  231. In c mode, this changes the directory before adding
  232. the following files.
  233. In x mode, change directories after opening the archive
  234. but before extracting entries from the archive.
  235. .TP
  236. \fB\--cachedir\fP \fIcache-dir\fP
  237. (c, d, print-stats, and fsck modes only)
  238. Cache information about the archives stored by
  239. \fB\%tarsnap\fP
  240. in the directory
  241. \fIcache-dir\fP.
  242. The contents of this directory will not be backed up by
  243. \fB\%tarsnap\fP,
  244. so it should not be used for any other purpose.
  245. If the directory
  246. \fIcache-dir\fP
  247. is lost, it can be reconstructed by running
  248. \fB\%tarsnap\fP \fB\--fsck\fP.
  249. .TP
  250. \fB\--check-links\fP
  251. (c mode only)
  252. Issue a warning message unless all links to each file are archived.
  253. .TP
  254. \fB\--checkpoint-bytes\fP \fIbytespercheckpoint\fP
  255. (c mode only)
  256. Create a checkpoint after every
  257. \fIbytespercheckpoint\fP
  258. bytes of uploaded data.
  259. The value
  260. \fIbytespercheckpoint\fP
  261. must be at least 1000000, and a higher value is recommended since
  262. creating a checkpoint in an archive can take a few seconds and several
  263. hundred kB of bandwidth.
  264. .TP
  265. \fB\--chroot\fP
  266. (x mode only)
  267. \fB\%chroot\fP()
  268. to the current directory after processing any
  269. \fB\-C\fP
  270. options and before extracting any files.
  271. .TP
  272. \fB\--configfile\fP \fIfilename\fP
  273. Add
  274. \fIfilename\fP
  275. to the list of configuration files to be read; options set via these take
  276. priority over the default configuration files.
  277. This option can be specified multiple times, in which case all the files
  278. will be read; where settings conflict, the earlier configuration file will
  279. take priority.
  280. .TP
  281. \fB\--creationtime\fP \fIX\fP
  282. (c mode only)
  283. Manually specify a creation time (a unix timestamp) for the archive.
  284. This is unlikely to be useful when tarsnap is being invoked directly from the
  285. command line.
  286. .TP
  287. \fB\--csv-file\fP \fIfilename\fP
  288. (use with
  289. \fB\--print-stats\fP)
  290. Write statistics in CSV format to a file.
  291. .TP
  292. \fB\--disk-pause\fP \fIX\fP
  293. (c mode only)
  294. Pause for
  295. \fIX\fP
  296. ms between storing archive entries and after every 64 kB of file data.
  297. This will slow down
  298. \fB\%tarsnap\fP
  299. and thereby reduce its impact on other applications.
  300. For archiving files which are stored on an ATA disk and are not in the
  301. operating system disk cache, a value of
  302. \fB\--disk-pause\fP \fI10\fP
  303. will approximately double the time taken.
  304. .TP
  305. \fB\--dry-run\fP
  306. (c mode only)
  307. Don't really create an archive; just simulate doing so.
  308. The list of paths added to an archive (if the
  309. \fB\-v\fP
  310. option is used), progress messages (if the
  311. \fB\--progress-bytes\fP
  312. option is used), and final statistics printed (if the
  313. \fB\--print-stats\fP
  314. option is used) will be almost identical (typically
  315. within a few kB or a fraction of a percent) to if
  316. \fB\%tarsnap\fP
  317. is run without the
  318. \fB\--dry-run\fP
  319. option.
  320. .PP
  321. Note that the
  322. \fB\--maxbw\fP
  323. option does not work in combination with
  324. \fB\--dry-run\fP,
  325. since no bandwidth is actually used, and that since
  326. \fB\%tarsnap\fP
  327. does not contact the
  328. \fB\%tarsnap\fP
  329. server when performing a dry run, it will not detect an
  330. attempt to create an archive with the same name as one
  331. which already exists.
  332. If an existing archive is being copied via
  333. \fB@@\fP\fIarchive-name\fP,
  334. then some network bandwidth will be used while
  335. \fB\%tarsnap\fP
  336. reads metadata about
  337. \fIarchive-name\fP
  338. from the tarsnap server.
  339. .PP
  340. Furthermore,
  341. \fB\--dry-run\fP
  342. will not check whether the cache directory is out of sync.
  343. .TP
  344. \fB\--dry-run-metadata\fP
  345. (c mode only)
  346. Don't really create an archive; just simulate doing so.
  347. This is similar to
  348. \fB\--dry-run\fP,
  349. except that it doesn't read any files; it only processes filesystem metadata.
  350. .PP
  351. This is significantly faster than a regular
  352. \fB\--dry-run\fP,
  353. but it is still suitable for checking which filesystem entries will be
  354. archived (with
  355. \fB\-v\fP),
  356. or getting the total uncompressed archive size (via
  357. \fB\--totals\fP
  358. or
  359. \fB\--progress-bytes\fP).
  360. .PP
  361. This option cannot be used with
  362. \fB\--print-stats\fP.
  363. .TP
  364. \fB\--dump-config\fP
  365. Print out the command-line and all non-blank lines read from config files.
  366. .TP
  367. \fB\--exclude\fP \fIpattern\fP
  368. (c, x, and t modes only)
  369. Do not process files or directories that match the
  370. specified pattern.
  371. Note that exclusions take precedence over patterns or filenames
  372. specified on the command line.
  373. .TP
  374. \fB\-f\fP \fIarchive-name\fP
  375. (c, d, x, t, r, list-archives, and print-stats modes only)
  376. Operate on the archive
  377. \fIarchive-name\fP.
  378. In mode c, if archive creation is interrupted by \&^Q,
  379. the SIGQUIT signal, or reaching the bandwidth limit
  380. specified via a
  381. \fB\--maxbw\fP
  382. option, the archive will be stored with
  383. ".part" appended to its name.
  384. In mode print-stats, if
  385. \fIarchive-name\fP
  386. is *, statistics will be printed for every archive.
  387. In the print-stats and d modes,
  388. \fB\-f\fP \fIarchive-name\fP
  389. can be specified multiple times, in which case the operation
  390. (printing statistics, or deletion) will be performed for each
  391. of the specified archives.
  392. .PP
  393. Note that each archive created must have a different name; consequently
  394. many users find it useful to include timestamps in archive names when
  395. repeatedly creating archives from the same files/directories (e.g.,
  396. daily backups).
  397. .PP
  398. As a special case, if used with
  399. \fB\--list-archives\fP -hashes
  400. then
  401. \fB\-f\fP
  402. indicates a
  403. \fItapehash\fP
  404. instead of an
  405. \fIarchive-name\fP,
  406. and will print metadata about the specified archive(s).
  407. This combination of options is intended for the GUI and is not needed for
  408. command-line usage.
  409. Po \fB\-f\fP
  410. cannot be used with
  411. \fB\--list-archives\fP
  412. if it does not also include
  413. \fB\--hashes\fP.
  414. Pc
  415. .TP
  416. \fB\--force-resources\fP
  417. Force the decryption of a passphrase-encrypted key file to proceed
  418. even if it is anticipated to require an excessive amount of memory
  419. or CPU time.
  420. .TP
  421. \fB\-H\fP
  422. (c mode only)
  423. Symbolic links named on the command line will be followed; the
  424. target of the link will be archived, not the link itself.
  425. .TP
  426. \fB\-h\fP
  427. (c mode only)
  428. Synonym for
  429. \fB\-L\fP.
  430. .TP
  431. \fB\--hashes\fP
  432. (list-archives mode only)
  433. Print hashes of archive names.
  434. If the
  435. \fB\-v\fP
  436. flag is specified one or more times, print the archive name as well.
  437. .PP
  438. This option is intended for the GUI and is not needed for command-line usage.
  439. .TP
  440. \fB\--humanize-numbers\fP
  441. Use SI prefixes to make numbers printed by
  442. \fB\--print-stats\fP
  443. and SIGINFO more readable.
  444. .TP
  445. \fB\-I\fP
  446. Synonym for
  447. \fB\-T\fP.
  448. .TP
  449. \fB\--include\fP \fIpattern\fP
  450. (c, x, and t modes only)
  451. Process only files or directories that match the specified pattern.
  452. Note that exclusions specified with
  453. \fB\--exclude\fP
  454. take precedence over inclusions.
  455. If no inclusions are explicitly specified, all entries are processed by
  456. default.
  457. The
  458. \fB\--include\fP
  459. option is especially useful when filtering archives.
  460. For example, the command
  461. .RS 4
  462. \fB\%tarsnap\fP \fB\-c\fP \fB\-f\fP \fIfoo-backup\fP \fB\--include='*foo*'\fP \fB@@\fP\fIall-backup\fP
  463. .RE
  464. creates a new archive
  465. \fIfoo-backup\fP
  466. containing only the entries from
  467. \fIall-backup\fP
  468. containing the string
  469. `foo'.
  470. .TP
  471. \fB\--insane-filesystems\fP
  472. (c mode only)
  473. Allow descent into synthetic filesystems such as procfs.
  474. Normally archiving of such filesystems is a silly thing to do, hence the
  475. name of the option.
  476. .TP
  477. \fB\--iso-dates\fP
  478. (t mode only)
  479. Print file and directory dates as yyyy-mm-dd hh:mm:ss.
  480. .PP
  481. The default is to use the same format as 'ls -l': If the files were modified
  482. within the past six months, print the month, day, hour, and minutes; otherwise,
  483. print the month, day, and year.
  484. .TP
  485. \fB\-k\fP
  486. (x mode only)
  487. Do not overwrite existing files.
  488. In particular, if a file appears more than once in an archive,
  489. later copies will not overwrite earlier copies.
  490. .TP
  491. \fB\--keep-going\fP
  492. (d and print-stats modes only)
  493. Continue deleting or printing statistics after finding that one
  494. of the archives specified does not exist.
  495. .TP
  496. \fB\--keep-newer-files\fP
  497. (x mode only)
  498. Do not overwrite existing files that are newer than the
  499. versions appearing in the archive being extracted.
  500. .TP
  501. \fB\--keyfile\fP \fIkey-file\fP
  502. (all modes)
  503. Obtain encryption, authentication, and access keys from
  504. \fIkey-file\fP.
  505. This file should have been generated by
  506. \fBtarsnap-keygen\fP(1).
  507. .TP
  508. \fB\-L\fP
  509. (c mode only)
  510. All symbolic links will be followed.
  511. Normally, symbolic links are archived as such.
  512. With this option, the target of the link will be archived instead.
  513. .TP
  514. \fB\-l\fP
  515. This is a synonym for the
  516. \fB\--check-links\fP
  517. option.
  518. .TP
  519. \fB\--lowmem\fP
  520. (c mode only)
  521. Reduce memory usage by not caching small files.
  522. This may be useful when backing up files of average size less
  523. than 1 MB if the available RAM in kilobytes is less than the
  524. number of files being backed up.
  525. .TP
  526. \fB\-m\fP
  527. (x mode only)
  528. Do not extract modification time.
  529. By default, the modification time is set to the time stored in the archive.
  530. .TP
  531. \fB\--maxbw\fP \fInumbytes\fP
  532. (c mode only)
  533. Interrupt archival if more than
  534. \fInumbytes\fP
  535. bytes of upstream bandwidth is used (see INTERRUPTING ARCHIVAL
  536. below for details).
  537. .TP
  538. \fB\--maxbw-rate\fP \fIbytespersecond\fP
  539. Limit download and upload bandwidth used to
  540. \fIbytespersecond\fP
  541. bytes per second.
  542. .TP
  543. \fB\--maxbw-rate-down\fP \fIbytespersecond\fP
  544. Limit download bandwidth used to
  545. \fIbytespersecond\fP
  546. bytes per second.
  547. .TP
  548. \fB\--maxbw-rate-up\fP \fIbytespersecond\fP
  549. Limit upload bandwidth used to
  550. \fIbytespersecond\fP
  551. bytes per second.
  552. .TP
  553. \fB\-n\fP
  554. (c mode only)
  555. Do not recursively archive the contents of directories.
  556. .TP
  557. \fB\--newer\fP \fIdate\fP
  558. (c, x, t modes only)
  559. Only include files and directories newer than the specified date.
  560. This compares ctime entries.
  561. .TP
  562. \fB\--newer-mtime\fP \fIdate\fP
  563. (c mode only)
  564. Like
  565. \fB\--newer\fP,
  566. except it compares mtime entries instead of ctime entries.
  567. .TP
  568. \fB\--newer-than\fP \fIfilename\fP
  569. (c mode only)
  570. Only include files and directories newer than the specified file.
  571. This compares ctime entries.
  572. .TP
  573. \fB\--newer-mtime-than\fP \fIfilename\fP
  574. (c mode only)
  575. Like
  576. \fB\--newer-than\fP,
  577. except it compares mtime entries instead of ctime entries.
  578. .TP
  579. \fB\--no-aggressive-networking\fP
  580. Ignore any
  581. \fBaggressive-networking\fP
  582. option specified in a configuration file.
  583. .TP
  584. \fB\--no-config-exclude\fP
  585. Ignore any
  586. \fBexclude\fP
  587. option specified in a configuration file.
  588. Normally
  589. \fBexclude\fP
  590. options specified via configuration files and the command line
  591. all take effect.
  592. .TP
  593. \fB\--no-config-include\fP
  594. Ignore any
  595. \fBinclude\fP
  596. option specified in a configuration file.
  597. Normally
  598. \fBinclude\fP
  599. options specified via configuration files and the command line
  600. all take effect.
  601. .TP
  602. \fB\--no-default-config\fP
  603. Do not read the default configuration files
  604. \fI@sysconfdir@/tarsnap.conf\fP,
  605. \fI$XDG_CONFIG_HOME/tarsnap/tarsnap.conf\fP,
  606. and
  607. \fI~/.tarsnaprc\fP.
  608. .TP
  609. \fB\--no-disk-pause\fP
  610. Ignore any
  611. \fBdisk-pause\fP
  612. option specified in a configuration file.
  613. .TP
  614. \fB\--no-force-resources\fP
  615. Ignore any
  616. \fBforce-resources\fP
  617. option specified in a configuration file.
  618. .TP
  619. \fB\--no-humanize-numbers\fP
  620. Ignore any
  621. \fBhumanize-numbers\fP
  622. option specified in a configuration file.
  623. .TP
  624. \fB\--no-insane-filesystems\fP
  625. Ignore any
  626. \fBinsane-filesystems\fP
  627. option specified in a configuration file.
  628. .TP
  629. \fB\--no-iso-dates\fP
  630. Ignore any
  631. \fBiso-dates\fP
  632. option specified in a configuration file.
  633. .TP
  634. \fB\--no-maxbw\fP
  635. Ignore any
  636. \fBmaxbw\fP
  637. option specified in a configuration file.
  638. .TP
  639. \fB\--no-maxbw-rate-down\fP
  640. Ignore any
  641. \fBmaxbw-rate-down\fP
  642. option specified in a configuration file.
  643. If a
  644. \fBmaxbw-rate\fP
  645. option is specified in a configuration file, it will
  646. not affect the download bandwidth used, but may affect
  647. the upload bandwidth used (unless
  648. \fB\--no-maxbw-rate-up\fP
  649. is also specified).
  650. .TP
  651. \fB\--no-maxbw-rate-up\fP
  652. Ignore any
  653. \fBmaxbw-rate-up\fP
  654. option specified in a configuration file.
  655. If a
  656. \fBmaxbw-rate\fP
  657. option is specified in a configuration file, it will
  658. not affect the upload bandwidth used, but may affect
  659. the download bandwidth used (unless
  660. \fB\--no-maxbw-rate-down\fP
  661. is also specified).
  662. .TP
  663. \fB\--no-noatime\fP
  664. Ignore any
  665. \fBnoatime\fP
  666. option specified in a configuration file.
  667. .TP
  668. \fB\--no-nodump\fP
  669. Ignore any
  670. \fBnodump\fP
  671. option specified in a configuration file.
  672. .TP
  673. \fB\--no-print-stats\fP
  674. Ignore any
  675. \fBprint-stats\fP
  676. option specified in a configuration file.
  677. .TP
  678. \fB\--no-progress-bytes\fP
  679. Ignore any
  680. \fBprogress-bytes\fP
  681. option specified in a configuration file.
  682. .TP
  683. \fB\--no-quiet\fP
  684. Ignore any
  685. \fBquiet\fP
  686. option specified in a configuration file.
  687. .TP
  688. \fB\--no-retry-forever\fP
  689. Ignore any
  690. \fBretry-forever\fP
  691. option specified in a configuration file.
  692. .TP
  693. \fB\--no-snaptime\fP
  694. Ignore any
  695. \fBsnaptime\fP
  696. option specified in a configuration file.
  697. .TP
  698. \fB\--no-store-atime\fP
  699. Ignore any
  700. \fBstore-atime\fP
  701. option specified in a configuration file.
  702. .TP
  703. \fB\--no-totals\fP
  704. Ignore any
  705. \fBtotals\fP
  706. option specified in a configuration file.
  707. .TP
  708. \fB\--noatime\fP
  709. (c mode only)
  710. Ask the operating system to not update the atime when reading files or
  711. directories. Not supported by all operating systems and filesystems.
  712. .TP
  713. \fB\--nodump\fP
  714. (c mode only)
  715. Honor the nodump file flag by skipping this file or directory.
  716. .TP
  717. \fB\--noisy-warnings\fP
  718. Be verbose when warning about network glitches.
  719. This is probably only useful for debugging purposes.
  720. .TP
  721. \fB\--normalmem\fP
  722. Ignore any
  723. \fBlowmem\fP
  724. or
  725. \fBverylowmem\fP
  726. option specified in a configuration file.
  727. .TP
  728. \fB\--null\fP
  729. (use with
  730. \fB\-I\fP,
  731. \fB\-T\fP,
  732. or
  733. \fB\-X\fP)
  734. Synonym for
  735. \fB\--null-input\fP.
  736. Kept for historical reasons and compatibility with other tar utilities.
  737. .TP
  738. \fB\--null-input\fP
  739. (use with
  740. \fB\-I\fP,
  741. \fB\-T\fP,
  742. or
  743. \fB\-X\fP)
  744. Filenames, archive names, and patterns are separated by null characters,
  745. not by newlines.
  746. This is often used to read filenames output by the
  747. \fB\-print0\fP
  748. option to
  749. \fBfind\fP(1).
  750. .TP
  751. \fB\--null-output\fP
  752. (x, t, and list-archives modes only)
  753. Archive names and filenames in output are separated by null characters, not by
  754. newlines.
  755. .PP
  756. If there are multiple fields on a line, they will be separated by two null
  757. characters.
  758. If a command line is printed within one of those fields, each argument will be
  759. separated by three null characters.
  760. .TP
  761. \fB\--numeric-owner\fP
  762. (x mode only)
  763. Ignore symbolic user and group names when restoring archives to disk,
  764. only numeric uid and gid values will be obeyed.
  765. .TP
  766. \fB\-O\fP
  767. (x and t modes only)
  768. In extract (-x) mode, files will be written to standard out rather than
  769. being extracted to disk.
  770. In list (-t) mode, the file listing will be written to stderr rather than
  771. the usual stdout.
  772. .TP
  773. \fB\-o\fP
  774. (x mode only)
  775. Use the user and group of the user running the program rather
  776. than those specified in the archive.
  777. Note that this has no significance unless
  778. \fB\-p\fP
  779. is specified, and the program is being run by the root user.
  780. In this case, the file modes and flags from
  781. the archive will be restored, but ACLs or owner information in
  782. the archive will be discarded.
  783. .TP
  784. \fB\--one-file-system\fP
  785. (c mode only)
  786. Do not cross mount points.
  787. .TP
  788. \fB\-P\fP
  789. (c, x, and t modes only)
  790. Preserve pathnames.
  791. By default, absolute pathnames (those that begin with a /
  792. character) have the leading slash removed both when creating archives
  793. and extracting from them.
  794. Also,
  795. \fB\%tarsnap\fP
  796. will refuse to extract archive entries whose pathnames contain
  797. \fI\& ..\fP
  798. or whose target directory would be altered by a symlink.
  799. This option suppresses these behaviors.
  800. .TP
  801. \fB\-p\fP
  802. (x mode only)
  803. Preserve file permissions.
  804. Attempt to restore the full permissions, including owner, file modes, file
  805. flags and ACLs, if available, for each item extracted from the archive.
  806. By default, newly-created files are owned by the user running
  807. \fB\%tarsnap\fP,
  808. the file mode is restored for newly-created regular files, and
  809. all other types of entries receive default permissions.
  810. If
  811. \fB\%tarsnap\fP
  812. is being run by root, the default is to restore the owner unless the
  813. \fB\-o\fP
  814. option is also specified.
  815. .TP
  816. \fB\--passphrase\fP \fImethod:arg\fP
  817. Read the passphrase using the specified method.
  818. .RS 5
  819. .TP
  820. \fIdev:tty-stdin\fP
  821. Attempt to read the passphrase from /dev/tty; if that fails, read it from stdin.
  822. This is the default behaviour.
  823. .TP
  824. \fIdev:stdin-once\fP
  825. Attempt to read the passphrase from stdin, and do so only once even when
  826. encrypting.
  827. This cannot be used if
  828. \fIinfile\fP
  829. is also stdin (aka '-').
  830. .TP
  831. \fIdev:tty-once\fP
  832. Attempt to read the passphrase from /dev/tty, and do so only once
  833. even when encrypting.
  834. .TP
  835. \fIenv:VAR\fP
  836. Read the passphrase from the environment variable specified by
  837. \fIVAR\fP.
  838. .PP
  839. Bf .IR
  840. Storing a passphrase in an environment variable may be a security risk.
  841. Ef
  842. Only use this option if you are certain that you know what you are doing.
  843. .TP
  844. \fIfile:FILENAME\fP
  845. Read the passphrase from the file specified by
  846. \fIFILENAME\fP.
  847. .PP
  848. Bf .IR
  849. Storing a passphrase in a file may be a security risk.
  850. Ef
  851. Only use this option if you are certain that you know what you are doing.
  852. .RE
  853. .TP
  854. \fB\--print-stats\fP
  855. (c and d modes only)
  856. Print statistics for the archive being created (c mode) or delete (d mode).
  857. See "PRINTING ARCHIVE STATISTICS" below for information on the output format.
  858. .TP
  859. \fB\--progress-bytes\fP \fIX\fP
  860. Display a progress message (as if generated from SIGUSR1 or SIGINFO) after
  861. processing each
  862. \fIX\fP
  863. bytes.
  864. Occurs at most once per file.
  865. .TP
  866. \fB\-q\fP (\fB\--fast-read\fP)
  867. (x and t modes only)
  868. Extract or list only the first archive entry that matches each pattern
  869. or filename operand.
  870. Exit as soon as each specified pattern or filename has been matched.
  871. By default, the archive is always read to the very end, since
  872. there can be multiple entries with the same name and, by convention,
  873. later entries overwrite earlier entries.
  874. This option is provided as a performance optimization.
  875. .TP
  876. \fB\--quiet\fP
  877. Avoid printing some warnings.
  878. Currently the warnings which are silenced by this option are
  879. "Removing leading '/' ...",
  880. "Not adding cache directory to archive",
  881. "... file may have grown while being archived",
  882. and
  883. "Skipping entry on filesystem of type ...",
  884. but it is likely that other
  885. warnings will be silenced by this option in future versions of
  886. \fB\%tarsnap\fP.
  887. .TP
  888. \fB\--resume-extract\fP
  889. (x mode only)
  890. Don't extract files whose filesize and mtime matches existing files on the
  891. disk.
  892. Primarily used to resume an archive extraction which was interrupted.
  893. The mtime comparison ignores sub-second timestamp precision, as this is not
  894. supported on all filesystems.
  895. This differs from
  896. \fB\-k\fP
  897. in that
  898. \fB\--resume-extract\fP
  899. will overwrite a file if the size or modification time do not match, as can
  900. happen if tarsnap is killed partway through extracting a file.
  901. .TP
  902. \fB\--retry-forever\fP
  903. This option causes tarsnap to continue trying to reconnect to the
  904. tarsnap server forever, instead of giving up after 5-10 minutes.
  905. This may be useful for people with excessively flaky networks, or
  906. on mobile devices which regularly lose their internet connections
  907. for extended periods of time.
  908. This is not enabled by default since continued failures generally indicate a
  909. problem which should be investigated by the user.
  910. .TP
  911. \fB\-S\fP
  912. (x mode only)
  913. Extract files as sparse files.
  914. For every block on disk, check first if it contains any non-NULL bytes and seek
  915. over it otherwise.
  916. This works similar to the conv=sparse option of dd.
  917. .TP
  918. \fB\-s\fP \fIpattern\fP
  919. Modify file or archive member names according to
  920. \fIpattern\fP.
  921. The pattern has the format /old/new/[gps].
  922. old is a basic regular expression.
  923. If it doesn't apply, the pattern is skipped.
  924. new is the replacement string of the matched part.
  925. ~ is substituted with the match, \e1 to \e9 with the contents of
  926. the corresponding captured group.
  927. The optional trailing g specifies that matching should continue
  928. after the matched part and stop on the first unmatched pattern.
  929. The optional trailing s specifies that the pattern applies to the value
  930. of symbolic links.
  931. The optional trailing p specifies that after a successful substitution
  932. the original path name and the new path name should be printed to
  933. standard error.
  934. .TP
  935. \fB\--snaptime\fP \fIfilename\fP
  936. (c mode only)
  937. This option MUST be specified when creating a backup from a filesystem
  938. snapshot, and
  939. \fIfilename\fP
  940. must have a modification time prior to when the filesystem snapshot was
  941. created.
  942. (This is necessary to prevent races between file modification and snapshot
  943. creation which could result in
  944. \fB\%tarsnap\fP
  945. failing to recognize that a file has been modified.)
  946. .TP
  947. \fB\--store-atime\fP
  948. (c mode only)
  949. Enable the storing of file access times.
  950. The default behaviour of
  951. \fB\%tarsnap\fP
  952. is to not store file access times, since this can cause a significant amount
  953. of bandwidth and storage to be wasted when the same set of files are archived
  954. several times (e.g., if daily backup archives are created) due to
  955. \fB\%tarsnap\fP
  956. itself accessing files and thereby causing their access times to be changed.
  957. .TP
  958. \fB\--strip-components\fP \fIcount\fP
  959. (x mode only)
  960. Remove the specified number of leading path elements.
  961. Pathnames with fewer elements will be silently skipped.
  962. Note that the pathname is edited after checking inclusion/exclusion patterns
  963. but before security checks.
  964. .TP
  965. \fB\-T\fP \fIfilename\fP
  966. (c, x, and t modes only)
  967. In x or t mode,
  968. \fB\%tarsnap\fP
  969. will read the list of names to be extracted from
  970. \fIfilename\fP.
  971. In c mode,
  972. \fB\%tarsnap\fP
  973. will read names to be archived from
  974. \fIfilename\fP.
  975. The special name
  976. ``-C''
  977. on a line by itself will cause the current directory to be changed to
  978. the directory specified on the following line.
  979. Names are terminated by newlines unless
  980. \fB\--null-input\fP
  981. is specified.
  982. Note that
  983. \fB\--null-input\fP
  984. also disables the special handling of lines containing
  985. ``-C''.
  986. If
  987. \fIfilename\fP
  988. is
  989. ``-''
  990. then the list of names will be read from the standard input.
  991. Note: If you are generating lists of files using
  992. \fBfind\fP(1),
  993. you probably want to use
  994. \fB\-n\fP
  995. as well.
  996. .TP
  997. \fB\--totals\fP
  998. (c mode only)
  999. Print the size of the archive after creating it.
  1000. This option is provided mainly for compatibility with GNU tar; in most
  1001. situations the
  1002. \fB\--print-stats\fP
  1003. option will be far more useful.
  1004. .TP
  1005. \fB\-U\fP
  1006. (x mode only)
  1007. Unlink files before creating them.
  1008. Without this option,
  1009. \fB\%tarsnap\fP
  1010. overwrites existing files, which preserves existing hardlinks.
  1011. With this option, existing hardlinks will be broken, as will any
  1012. symlink that would affect the location of an extracted file.
  1013. .TP
  1014. \fB\-v\fP
  1015. (c, d, t, x, and list-archives modes only)
  1016. Produce verbose output.
  1017. In create and extract modes,
  1018. \fB\%tarsnap\fP
  1019. will list each file name as it is read from or written to
  1020. the archive.
  1021. In delete mode,
  1022. \fB\%tarsnap\fP
  1023. will list the name of each archive as it is deleted.
  1024. In list mode,
  1025. \fB\%tarsnap\fP
  1026. will produce output similar to that of
  1027. \fBls\fP(1).
  1028. Additional
  1029. \fB\-v\fP
  1030. options will provide additional detail.
  1031. .TP
  1032. \fB\--verify-config\fP
  1033. Check the configuration file(s) for syntactic errors.
  1034. .TP
  1035. \fB\--version\fP
  1036. Print version number of
  1037. \fB\%tarsnap\fP,
  1038. and exit.
  1039. .TP
  1040. \fB\--verylowmem\fP
  1041. (c mode only)
  1042. Reduce memory usage, by approximately a factor of 2 beyond
  1043. the memory usage when
  1044. \fB\--lowmem\fP
  1045. is specified, by not caching anything.
  1046. .TP
  1047. \fB\-w\fP
  1048. (c and x modes only)
  1049. Ask for confirmation for every action.
  1050. .TP
  1051. \fB\-X\fP \fIfilename\fP
  1052. (c, x, and t modes only)
  1053. Read a list of exclusion patterns from the specified file.
  1054. See
  1055. \fB\--exclude\fP
  1056. for more information about the handling of exclusions.
  1057. .RE
  1058. .SH SIGNALS
  1059. .ad l
  1060. \fB\%tarsnap\fP
  1061. handles the following signals:
  1062. .RS 5
  1063. .TP
  1064. SIGUSR1 & SIGINFO
  1065. On receipt of the SIGUSR1 signal or (on platforms where it exists) the
  1066. SIGINFO signal,
  1067. \fB\%tarsnap\fP
  1068. prints the current file or directory being processed, and (for files)
  1069. its progress within the file.
  1070. It also prints the number of files and the number of uncompressed bytes
  1071. processed.
  1072. Note that due to network buffering the file position will not align precisely
  1073. with how much data has been sent to or received from the
  1074. \fB\%tarsnap\fP
  1075. server.
  1076. .TP
  1077. SIGSTOP & SIGTSTP
  1078. On receipt of a SIGSTOP or SIGTSTP signal, the kernel will suspend the
  1079. \fB\%tarsnap\fP
  1080. process.
  1081. Upon receiving a SIGCONT signal,
  1082. \fB\%tarsnap\fP
  1083. will reconnect to the server (if necessary) and continue the specified task.
  1084. .TP
  1085. SIGUSR2
  1086. On receipt of the SIGUSR2 signal, if
  1087. \fB\%tarsnap\fP
  1088. is creating an archive (mode c), it will create a checkpoint at the
  1089. current position.
  1090. .TP
  1091. SIGQUIT
  1092. On receipt of the SIGQUIT signal, if
  1093. \fB\%tarsnap\fP
  1094. is creating an archive (mode c) it will truncate the archive at the
  1095. current position and exit (see "INTERRUPTING ARCHIVAL" below).
  1096. .RE
  1097. .SH PRINTING ARCHIVE STATISTICS
  1098. .ad l
  1099. There are four commands which print statistics about archives:
  1100. .RS 5
  1101. .IP \(bu
  1102. Global statistics:
  1103. .RS 4
  1104. \fB\%tarsnap\fP \fB\--print-stats\fP
  1105. .RE
  1106. .IP \(bu
  1107. Global statistics and info about specific archive(s):
  1108. .RS 4
  1109. \fB\%tarsnap\fP \fB\--print-stats\fP \fB\-f\fP \fIarchive-name1\fP [\fB\-f\fP \fI...\fP]
  1110. .RE
  1111. .IP \(bu
  1112. Global statistics and info about all archives:
  1113. .RS 4
  1114. \fB\%tarsnap\fP \fB\--print-stats\fP \fB\-f\fP \fI'*'\fP
  1115. .RE
  1116. .IP \(bu
  1117. Global statistics and info about the archive(s) that were just created or
  1118. deleted:
  1119. .RS 4
  1120. \fB\%tarsnap\fP \fB\-c\fP \fB\--print-stats\fP \fB\-f\fP \fIarchive-name\fP \fIDIR\fP
  1121. .RE
  1122. .RS 4
  1123. \fB\%tarsnap\fP \fB\-d\fP \fB\--print-stats\fP \fB\-f\fP \fIarchive-name1\fP [\fB\-f\fP \fI...\fP]
  1124. .RE
  1125. .RE
  1126. .PP
  1127. \fB\%tarsnap\fP
  1128. will print a table in the following format:
  1129. .RS 4
  1130. .nf
  1131. Total size Compressed size
  1132. All archives 104491640436 51510524844
  1133. (unique data) 14830618089 7733620463
  1134. This archive 808723344 289077325
  1135. New data 17858641 5658308
  1136. .RE
  1137. .PP
  1138. In this example, the combined size of all archives stored by
  1139. \fB\%tarsnap\fP
  1140. using the same keys is 104 GB, and the combined size post-compression
  1141. would be 51 GB; but after removing duplicate blocks, there is only 14.8 GB
  1142. which is compressed down to 7.7 GB.
  1143. (It is this 7.7 GB which is stored via the Tarsnap service and must
  1144. thus be paid for.)
  1145. The newly created archive is 808 MB in size (compressible to 289 MB), but
  1146. only 17.8 MB of the data is new, and after compression only 5.6 MB is
  1147. uploaded to the Tarsnap server.
  1148. .PP
  1149. When
  1150. \fB\%tarsnap\fP
  1151. \fB\--print-stats\fP
  1152. is executed as a command, the table is printed to the standard output;
  1153. when the
  1154. \fB\--print-stats\fP
  1155. option is used while creating or deleting archives, the table is printed
  1156. to the standard error device.
  1157. .PP
  1158. Global statistics are calculated based on the current cache directory, without
  1159. using the keyfile or querying the Tarsnap servers.
  1160. .SH INTERRUPTING ARCHIVAL
  1161. .ad l
  1162. Upon receipt of the
  1163. .BR SIGQUIT
  1164. signal or \&^Q,
  1165. or if the bandwidth limit specified via a
  1166. \fB\--maxbw\fP
  1167. option is reached,
  1168. \fB\%tarsnap\fP
  1169. will interrupt the creation of an archive and truncate it
  1170. at the current position.
  1171. When an archive is truncated, it will be named according to
  1172. the user-specified name plus ".part" to denote the fact that
  1173. it is incomplete.
  1174. Such a truncated archive may be useful in its own right, but
  1175. also offers the benefit that future attempts to archive the
  1176. same data will be faster and use less bandwidth.
  1177. .SH FIREWALLS
  1178. .ad l
  1179. \fB\%tarsnap\fP
  1180. communicates with the
  1181. \fB\%tarsnap\fP
  1182. server via a TCP connection to port 9279; in some environments
  1183. it may be necessary to add a firewall rule to allow outgoing
  1184. TCP connections to this port.
  1185. At the present time (July 2009) there is only one IP address in
  1186. use for the
  1187. \fB\%tarsnap\fP
  1188. server, so network administrators may wish to hard-code that IP
  1189. address; however, it is likely that at some point in the future
  1190. that IP address will change and/or other IP addresses will be
  1191. added.
  1192. .SH ENVIRONMENT
  1193. .ad l
  1194. The following environment variables affect the execution of
  1195. \fB\%tarsnap\fP:
  1196. .RS 5
  1197. .TP
  1198. .B LANG
  1199. The locale to use.
  1200. See
  1201. \fBenviron\fP(7)
  1202. for more information.
  1203. .TP
  1204. .B TZ
  1205. The timezone to use when displaying dates.
  1206. See
  1207. \fBenviron\fP(7)
  1208. for more information.
  1209. .RE
  1210. .SH FILES
  1211. .ad l
  1212. .RS 5
  1213. .TP
  1214. .B @sysconfdir@/tarsnap.conf
  1215. The system global
  1216. \fB\%tarsnap\fP
  1217. configuration file.
  1218. Parameters specified here only take effect if they are not
  1219. specified via the current user's local configuration file
  1220. or via the command line.
  1221. .TP
  1222. .B $XDG_CONFIG_HOME/tarsnap/tarsnap.conf
  1223. A
  1224. \fB\%tarsnap\fP
  1225. configuration file for the current user.
  1226. If the environment variable
  1227. .IR XDG_CONFIG_HOME
  1228. is empty, the default value of
  1229. \fI~/.config/tarsnap/tarsnap.conf\fP
  1230. will be used.
  1231. Parameters specified here take effect unless they are specified via
  1232. \fI~/.tarsnaprc\fP
  1233. or the command line.
  1234. .TP
  1235. .B ~/.tarsnaprc
  1236. Another location for the
  1237. \fB\%tarsnap\fP
  1238. configuration file for the current user.
  1239. Parameters specified here take effect unless they are
  1240. specified via the command line.
  1241. .RE
  1242. .SH EXIT STATUS
  1243. .ad l
  1244. The \fBtarsnap\fP utility exits 0 on success, and >0 if an error occurs.
  1245. .PP
  1246. An exit code of 2 indicates that an error has occurred and the server-side
  1247. state was modified.
  1248. .SH EXAMPLES
  1249. .ad l
  1250. Register with the server and generate keys:
  1251. .RS 4
  1252. \fB\%tarsnap-keygen\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\--user\fP \fIme@example.com\fP \fB\--machine\fP \fImyserver\fP
  1253. .RE
  1254. .PP
  1255. Perform a backup of
  1256. \fI/usr/home\fP
  1257. and
  1258. \fI/other/stuff/to/backup\fP:
  1259. .RS 4
  1260. \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\--cachedir\fP \fI/usr/tarsnap-cache\fP \fB\-c\fP \fB\-f\fP \fIbackup-2008-04-24\fP \fI/usr/home\fP \fI/other/stuff/to/backup\fP
  1261. .RE
  1262. .PP
  1263. Perform another backup, a day later;
  1264. this is much faster since tarsnap will avoid
  1265. storing data which was previously stored:
  1266. .RS 4
  1267. \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\--cachedir\fP \fI/usr/tarsnap-cache\fP \fB\-c\fP \fB\-f\fP \fIbackup-2008-04-25\fP \fI/usr/home\fP \fI/other/stuff/to/backup\fP
  1268. .RE
  1269. .PP
  1270. List the archives:
  1271. .RS 4
  1272. \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\--list-archives\fP
  1273. .RE
  1274. .PP
  1275. Delete the first backup, leaving the second backup intact:
  1276. .RS 4
  1277. \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\--cachedir\fP \fI/usr/tarsnap-cache\fP \fB\-d\fP \fB\-f\fP \fIbackup-2008-04-24\fP
  1278. .RE
  1279. .PP
  1280. List the files in the remaining backup:
  1281. .RS 4
  1282. \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\-tv\fP \fB\-f\fP \fIbackup-2008-04-25\fP
  1283. .RE
  1284. .PP
  1285. Restore two users' home directories from the backup:
  1286. .RS 4
  1287. \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\-x\fP \fB\-f\fP \fIbackup-2008-04-25\fP \fIusr/home/auser\fP \fIusr/home/anotheruser\fP
  1288. .RE
  1289. .PP
  1290. In
  1291. \fI/etc/crontab\fP
  1292. to create a backup of the entire system at 10:32 each day:
  1293. .RS 4
  1294. 32 10 * * * root \fB\%tarsnap\fP \fB\--keyfile\fP \fI/usr/tarsnap.key\fP \fB\--cachedir\fP \fI/usr/tarsnap-cache\fP \fB\-c\fP \fB\-f\fP \fIbackup-`date\fP +\e%Y\e%m\e%d` \fI/\fP
  1295. .RE
  1296. .PP
  1297. Note that the
  1298. \fB\--keyfile\fP
  1299. and
  1300. \fB\--cachedir\fP
  1301. options can be specified via the
  1302. \fBtarsnap.conf\fP(5)
  1303. configuration file, in which case they may be omitted
  1304. from the command line.
  1305. .SH SECURITY
  1306. .ad l
  1307. Certain security issues are common to many archiving programs, including
  1308. \fB\%tarsnap\fP.
  1309. In particular, carefully-crafted archives can request that
  1310. \fB\%tarsnap\fP
  1311. extract files to locations outside of the target directory.
  1312. This can potentially be used to cause unwitting users to overwrite
  1313. files they did not intend to overwrite.
  1314. If the archive is being extracted by the superuser, any file
  1315. on the system can potentially be overwritten.
  1316. There are three ways this can happen.
  1317. Although
  1318. \fB\%tarsnap\fP
  1319. has mechanisms to protect against each one,
  1320. savvy users should be aware of the implications:
  1321. .RS 5
  1322. .IP \(bu
  1323. Archive entries can have absolute pathnames.
  1324. By default,
  1325. \fB\%tarsnap\fP
  1326. removes the leading
  1327. \fI/\fP
  1328. character from filenames before restoring them to guard against this problem.
  1329. .IP \(bu
  1330. Archive entries can have pathnames that include
  1331. \fI\& ..\fP
  1332. components.
  1333. By default,
  1334. \fB\%tarsnap\fP
  1335. will not extract files containing
  1336. \fI\& ..\fP
  1337. components in their pathname.
  1338. .IP \(bu
  1339. Archive entries can exploit symbolic links to restore
  1340. files to other directories.
  1341. An archive can restore a symbolic link to another directory,
  1342. then use that link to restore a file into that directory.
  1343. To guard against this,
  1344. \fB\%tarsnap\fP
  1345. checks each extracted path for symlinks.
  1346. If the final path element is a symlink, it will be removed
  1347. and replaced with the archive entry.
  1348. If
  1349. \fB\-U\fP
  1350. is specified, any intermediate symlink will also be unconditionally removed.
  1351. If neither
  1352. \fB\-U\fP
  1353. nor
  1354. \fB\-P\fP
  1355. is specified,
  1356. \fB\%tarsnap\fP
  1357. will refuse to extract the entry.
  1358. .RE
  1359. .PP
  1360. Although
  1361. \fB\%tarsnap\fP
  1362. cryptographically signs archives in such a manner that it is believed
  1363. to be unfeasible for an attacker to forge an archive without having
  1364. possession of
  1365. \fIkey-file\fP,
  1366. you may wish to examine the contents of archive(s) with
  1367. .RS 4
  1368. \fB\%tarsnap\fP \fB\-t\fP \fB\--keyfile\fP \fIkey-file\fP \fB\-f\fP \fIarchive-name\fP
  1369. .RE
  1370. before extraction.
  1371. Note that the
  1372. \fB\-P\fP
  1373. option to
  1374. \fB\%tarsnap\fP
  1375. disables the security checks above and allows you to extract
  1376. an archive while preserving any absolute pathnames,
  1377. \fI\& ..\fP
  1378. components, or symlinks to other directories.
  1379. .SH SEE ALSO
  1380. .ad l
  1381. \fBtarsnap-keygen\fP(1),
  1382. \fBtar\fP(5),
  1383. \fBtarsnap.conf\fP(5)
  1384. .SH HISTORY
  1385. .ad l
  1386. A
  1387. \fB\%tar\fP
  1388. command appeared in Seventh Edition Unix, which was
  1389. released in January, 1979.
  1390. There have been numerous other implementations,
  1391. many of which extended the file format.
  1392. John Gilmore's
  1393. \fB\%pdtar\fP
  1394. public-domain implementation (circa November, 1987)
  1395. was quite influential, and formed the basis of GNU tar.
  1396. GNU tar was included as the standard system tar
  1397. in
  1398. FreeBSD
  1399. beginning with
  1400. FreeBSD 1.0,
  1401. but was replaced by Tim Kientzle's
  1402. \fB\%bsdtar\fP
  1403. utility and
  1404. \fBlibarchive\fP(3)
  1405. library in
  1406. FreeBSD 5.3.
  1407. .PP
  1408. \fB\%tarsnap\fP
  1409. is built around
  1410. \fB\%bsdtar\fP
  1411. and
  1412. \fBlibarchive\fP(3).
  1413. .SH BUGS
  1414. .ad l
  1415. This program follows
  1416. ISO/IEC 9945-1:1996 (``POSIX.1'')
  1417. for the definition of the
  1418. \fB\-l\fP
  1419. option to
  1420. \fBtar\fP(5).
  1421. Note that GNU tar prior to version 1.15 treated
  1422. \fB\-l\fP
  1423. as a synonym for the
  1424. \fB\--one-file-system\fP
  1425. option.
  1426. .PP
  1427. To archive a file called
  1428. \fI@foo\fP,
  1429. \fI@@foo\fP,
  1430. or
  1431. \fI-foo\fP
  1432. you must specify it as
  1433. \fI\& ./@foo\fP,
  1434. \fI\& ./@@foo\fP,
  1435. or
  1436. \fI\& ./-foo\fP,
  1437. respectively.
  1438. .PP
  1439. In create mode, a leading
  1440. \fI\& ./\fP
  1441. is always removed.
  1442. A leading
  1443. \fI/\fP
  1444. is stripped unless the
  1445. \fB\-P\fP
  1446. option is specified.
  1447. .PP
  1448. Hard link information may be lost if an archive file which is included via the
  1449. \fB@\fP\fIarchive-file\fP
  1450. option is in a non-"tar" format.
  1451. (This is a consequence of the incompatible ways that different archive
  1452. formats store hardlink information.)
  1453. .PP
  1454. There are alternative long options for many of the short options that
  1455. are deliberately not documented.
  1456. .PP
  1457. The limit specified by a
  1458. \fB\--maxbw\fP
  1459. option is not strictly enforced;
  1460. in particular, due to the need to cleanly terminate an archive, the
  1461. amount of bandwidth used may slightly exceed the limit.
  1462. .PP
  1463. If
  1464. \fB\%tarsnap\fP
  1465. is run with standard input, standard output, and standard error
  1466. redirected and inside a chroot where terminal devices are not
  1467. exposed, \&^Q will not be mapped to SIGQUIT and will consequently not
  1468. trigger the truncation of the current archive.