Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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) ...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
2  
I have found it out: tar -czvf /var/backups/svn.tgz -C / var/svn/ –  dan Nov 11 '10 at 15:13

Your Answer

 
discard

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.