Tar: kill the error message: ‘tar: Removing leading `/’ from member names’

stderrtar

I run this from a cronjob:

tar -czvf /var/backups/svn.tgz /var/svn/*

That generates this on stderr:

tar: Removing leading `/' from member names

I would like to avoid this because it is not a real error (for me!).
I want on stderr only things that I should worry about?

How can I kill that message?

I have the feeling that it is a matter of using the tar -C option but I am not sure and I don't know how.

Thanks for the help,
Dan

Best Answer

your options:

-P, --absolute-names : don't strip leading `/'s from file names

or

-C /

... and a relative path for things to go into the tar, like so:

tar -C / -czvf /var/backups/svn.tgz var/svn/*