Score:0

Rsync: Exclude files by maximum filename length (< 143 characters)

je flag

A cronjob copies files from a remote server (probably ext4) via rsync to a local encrypted partition (probably eCryptFS on top of ext4).

Now rsync throws errors for filenames that are longer than 143, which is expected due to the way filenames are encrypted on the target.

Since I can't change those parameters, I can't influence the files to be backed-up and there's only a handful of those that fail, I want to ignore / exclude the files in question.

I thought about running a find for files with names longer than 143 characters, writing to a temporary file and then using that as the --exclude-from for rsync.

But is there a more elegant and reliable way to do this I'm missing? I don't want the cronjob to skip more files than strictly necessary, but I also need it to run without errors to not trigger a monitoring alert.

je flag
I ended up using this `find` command to create a list of files to exclude https://stackoverflow.com/a/42944001 and wrote the list to a temporary file, then I used the `--exclude-from` option to reference the file when running `rsync`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.