Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm executing a command like the following to several different systems:

$ rsync -a -v'/path/to/first/*.log path/to/second.txt' /dest/folder/0007/.

Sometimes *.log does not exist, and that's OK, but rsync generates the following error:

receiving file list ... rsync: link_stat "/path/to/first/*.log" failed: No such file or directory (2)

Is there any way to suppress that? The only way I can think of is to use include and exclude filters, which just seem a PITA to me. Thanks!

share|improve this question
up vote 2 down vote accepted

I think the answer to the question is best described in this answer:


Unfortunately, only later versions have this functionality. I am running RHEL 7 with rsync 3.0.9, which does not seem to have this option.

share|improve this answer

To clarify, you would just like to not 'see' the error? For that case you could just redirect the Standard Error Output, but you may end up missing a more serious error that you might want to know of.

Redirect Error Output Example

rsync -a -v'/path/to/first/*.log path/to/second.txt' /dest/folder/0007/ 2>/dev/null

If instead you are looking to only miss the error on a file that doesn't exist, you can't change the rsync *.log filter and you want to avoid using includes, you could wrap it in a script to proceed based on the condition.

Script Example

# Script to Handle Rsync based on Log File Existence
if [ "$(ls -A /path/to/first/*.log > /dev/null > 2&1)" ]; then
     # Log Exists Use This Rsync
    rsync -a -v'/path/to/first/*.log path/to/second.txt' /dest/folder/0007/
    # Log Does Not Exist Use This Rsync
    rsync -a -v'path/to/second.txt' /dest/folder/0007/

Hope I was some help.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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