4

I want to backup the /home/.ecryptfs folder on my machine using rsync. I don't want to back up the unencrypted files. However, I want to exclude certain folders. For example, music, downloads, or virtual machines.

I have figured out that if I run the command a few times, and look through things carefully I can find the corresponding ECRYPTFS_FNEK_ENCRYPTED.XXXX-XXX-- folder. However, I'm wondering if there is a more efficient method.

2 Answers 2

2

Did you look at the eCryptfs tools? Specifically

ecryptfs-find - use inode numbers to match encrypted/decrypted filenames

SYNOPSIS
ecryptfs-find cleartext-filename ECRYPTFS_FNEK_ENCRYPTED.fwBGx18a.UcYl18CF7VKLMSDuEadV

DESCRIPTION
This program will attempt to match encrypted filenames to their decrypted counterpart, and attempt to match decrypted filenames to their encrypted counterpart.

Notes:
- the eCryptfs filesystem must be mounted in order to work
- it uses ls(1) in order to determine the inode
- it uses find(1) in order to locate the inode

And, you could always move some of the (larger) folders (that contain no sensitive data) out of your encrypted home, music might be a good candidate to be unencrypted.

0

The solution is to use --exclude using the file to exclude in their encrypted form

rsync --exclude=`ecryptfs-map folder-to-exclude` source target

ecryptfs-map can be found at https://gist.github.com/monperrus/7a114ccc1c2fd20dcc5e852cdf813c5d

You must log in to answer this question.