21

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

Dan
  • 369

2 Answers2

17

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/*
iiegn
  • 314
0

You can write

# ( tar czvf tar.file /path 2>&1 ) >log.file

The message will be written to log.file

HBruijn
  • 84,206
  • 24
  • 145
  • 224