Shell command to filter out non-existing files in a pipe

Try use perl oneliner for this

like

cat filelist | perl -ne 'chomp(); if (-e $_) {print "$_\n"}' | tar -T- -zcvf backup.tar.gz

Here are a couple of alternatives.

tar -ztf patch.tar.gz | grep -v "/$" | xargs -i sh -c 'test -f {} && echo {}' | tar -T- -zcvf backup.tar.gz

or

tar -ztf patch.tar.gz | grep -v "/$" | tar --ignore-failed-read -T- -zcvf backup.tar.gz

The second example will exit with status zero after an attempt to backup a file that does not exist (tested on Centos 6.5), which avoids the problem.