Server Fault is a question and answer site for system and network administrators. 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 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,

share|improve this question
up vote 9 down vote accepted

your options:

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


-C /

(and a relative path for things to go into the tar) ...depends on what you want.

Example usage of creating a tar archive using the -C option (thus removing leaning slash):

tar -czf /tmp/archive.tgz -C /etc .
share|improve this answer
I don't want -P. I want -C but I can't get it to work. – dan Nov 11 '10 at 15:11
I have found it out: tar -czvf /var/backups/svn.tgz -C / var/svn/ – dan Nov 11 '10 at 15:13

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.