5

I want to exclude symbolic links from an rsync, but --no-links floods my terminal with skipping non-regular file for every link, taking focus from other important information from rsync.

How can I exclude links without being pestered about each individual occurrence? The following are not acceptable solutions:

  1. Using the -q option, as this suppresses all output from rsync
  2. Filtering the message with grep
  3. Meticulously altering my include file around the links are not good options.

If this is is impossible (as it may seem): Why is skipping non-regular files considered so important that the user is explicitly warned about every single one of them even when he has specified he wants to exclude them? I'm tempted to take this up as an issue with the developer.

| improve this question | | | | |
2

If you don't want to see messages about any skipped files, you can use --info=skip0 if your version of rsync is not too old.

If you don't want to see messages on skipped symbolic links, but do want the messages if any other files are skipped, then unfortunately rsync's output control options don't seem to be fine-grained enough for that.

See rsync --info=help for a list of things you can adjust in rsync output.

| improve this answer | | | | |
1

You can use --files-from to define the list of files to sync, and use find to exclude symlinks:

rsync --files-from=<(find . ! -type l -print) . TARGET/
| improve this answer | | | | |
  • Yes, this works, but then I have to run a separate rsync for these files only. It would have been nice to include it with the main rsync backup. – forthrin May 28 '18 at 20:18
  • @forthin nothing stops you from running the find from the top level of your backup source. And use elaborate rules to only skip symlinks in directories you want to ignore them :-) – nohillside May 29 '18 at 4:16
1

Try adding this after your rsync command:

| grep -v "skipping non-regular file"

if those are the only things generating those messages, it will filter them. You may even do a "^skipping" if it's at the beginning of the line.

| improve this answer | | | | |
  • That's what I do, but the original poster specified that 'grep' was not acceptable. – Adam Wildavsky Nov 12 '19 at 18:16

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.