2

similar question: Encrypting and compressing

I want to make a regular backup and store it as encrypted tar archive. That's achievable using tar and gpg. But for incremental backups this would require to decrypt the entire archive.

  1. Is there a way to decrypt only a single file from that archive?
  2. As workaround, would it be safe to encrypt the single files rather than the entire archive?
  3. Are there other linux tools that are more suitable for encrypted incremental backups?
  • Most archives are not designed for direct access and would be quite inefficient in dealing with this whether encrypted or not. The simplest approach is to make a backup folder instead of an archive. – Julie Pelletier Jul 15 '16 at 13:51
  • 1
    You could have a look at dar it does direct access in incremental archives, individually compressed/encrypted files... even more complicated to use than tar though. – frostschutz Jul 15 '16 at 13:56
  • Or duplicity. Also more complicated than tar but very good at handling encrypted incrementals – roaima Jul 15 '16 at 14:56
0
  1. Yes, using a pipe from gpg to tar, and tar can extract just one file, but you may have to read & decrypt most or all of the archive depending on where the wanted file is (start or end). The entire archive is not saved anywhere, but tar still has to search through it.

  2. Yes, keeping a list of & only saving the new & changed files for the incremental backups (between full backups) could be a better idea.

  3. As mentioned, dedicated backup programs that also encrypt could be easier & maybe "better", google may be a good starting point.

    Using a LUKS container would allow random file access, and I think I read about some filesystems that automatically save old versions of files, or at least snapshots...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.