tarsnap-recrypt.1-mdoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .\" Copyright 2011-2025 Tarsnap Backup Inc.
  2. .\" All rights reserved.
  3. .\"
  4. .Dd @DATE@
  5. .Dt TARSNAP-RECRYPT 1
  6. .Os
  7. .Sh NAME
  8. .Nm tarsnap-recrypt
  9. .Nd re-encrypts data stored using
  10. .Xr tarsnap 1
  11. .Sh SYNOPSIS
  12. .Nm
  13. .Fl -oldkey Ar old-key-file
  14. .Fl -oldcachedir Ar old-cache-dir
  15. .Fl -newkey Ar new-key-file
  16. .Fl -newcachedir Ar new-cache-dir
  17. .Nm
  18. .Fl -version
  19. .Sh DESCRIPTION
  20. .Nm
  21. downloads and decrypts data using
  22. .Ar old-key-file
  23. and re-encrypts and uploads it using
  24. .Ar new-key-file .
  25. After all the data has been re-uploaded,
  26. .Nm
  27. deletes the data using
  28. .Ar old-key-file
  29. so that the only remaining copy of the data
  30. is encrypted using
  31. .Ar new-key-file .
  32. The key file
  33. .Ar new-key-file
  34. must have been generated by
  35. .Xr tarsnap-keyregen 1
  36. with
  37. .Ar old-key-file .
  38. .Pp
  39. .Nm
  40. checkpoints its progress after every 1-2 GB of data that it has
  41. copied; if it is interrupted it can be re-run and it will
  42. attempt to continue.
  43. .Pp
  44. Note that after
  45. .Nm
  46. completes it will be possible to store more archives using the key
  47. .Ar old-key-file
  48. and the cache directory
  49. .Ar old-cache-dir
  50. so care should be taken to disable any automatic (e.g.,
  51. .Xr cron 8 )
  52. archiving while
  53. .Nm
  54. is run.
  55. .Pp
  56. The
  57. .Fl -version
  58. option prints the version number of
  59. .Nm ,
  60. then exits.
  61. .Sh EXAMPLES
  62. The following sequence of commands will create new keys and re-encrypt
  63. data, assuming that the currently used keys are in
  64. .Pa /root/tarsnap.key
  65. and the current cache directory is
  66. .Pa /usr/local/tarsnap-cache :
  67. .Pp
  68. .Dl Cm tarsnap-keyregen Fl -keyfile Pa /root/tarsnap.key.new Fl -oldkey Pa /root/tarsnap.key Fl -user Ar me@example.com Fl -machine Ar myserver
  69. .Pp
  70. .Dl Nm Fl -oldkey Pa /root/tarsnap.key Fl -oldcachedir Pa /usr/local/tarsnap-cache Fl -newkey Pa /root/tarsnap.key.new Fl -newcachedir Pa /usr/local/tarsnap-cache.new
  71. .Pp
  72. .Dl Cm rm Fl r Pa /usr/local/tarsnap-cache
  73. .Pp
  74. .Dl Cm mv Pa /usr/local/tarsnap-cache.new Pa /usr/local/tarsnap-cache
  75. .Pp
  76. .Dl Cm rm Pa /root/tarsnap.key
  77. .Pp
  78. .Dl Cm mv Pa /root/tarsnap.key.new Pa /root/tarsnap.key