1

I would like to compress backup directory, but not saving all path of data. After unpack i want have only destination directory. How Can I do this?

This command save all path:

$tar -czf /home/user/backup/www_`date +%Y-%m-%d`.tar.gz /home/user/www

$ tar -xvf redmine_www_2018-03-02.tar.gz 
home/user/www/
0

1 Answer 1

4

This has already been answered a million times:

tar -czf /home/user/backup/www_`date +%Y-%m-%d`.tar.gz -C /home/user/www .
2
  • 1
    And since it’s been answered a million times, the appropriate reaction isn’t to add yet another answer, but to find an appropriate duplicate and vote for it. Commented Mar 2, 2018 at 13:46
  • Well you're right, we should start to educate and stop with the spoiling... Commented Mar 2, 2018 at 16:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.