Ignore sockets during tar backup

If you want to skip error sockets-related code during backup of whole filesystem you will be surprised there's no –ignore-sockets switch. But there's elegant method to to that:

cd /
sudo find . -type s > /tmp/sockets.lst
if sudo tar zcvpf $TMP_FILE --one-file-system --exclude-from=/tmp/sockets.lst -C / .
then
    echo backup OK
fi
This entry was posted in en and tagged , . Bookmark the permalink.

One Response to Ignore sockets during tar backup

  1. Felix says:

    You can suppress the warnings:

    sudo tar zcvpf $TMP_FILE --one-file-system --warning=no-file-ignored -C / . &

Comments are closed.