tar -cxf /home/user/backup/site.tar.gz
/var/www/
tar: Removing leading `/' from member names
it means: tar archives don't contain absolute paths, only relative ones (in your case, relative to the root directory). so it remove leading "/' for file names.
It gives you more flexibility about where to restore files. You may want to restore files into a temporary location. The relative path makes this possible. If the file paths in the tar archive were absolute then you would have to chroot into a temporary directory in order to restore the files anywhere but their original location.
To avoid this message you can use "-P" option, wich indicate tar store full absolute path in archive. But use this option cautiously when extracting with absolute pathnames or relative symbolic links that contain "..", because it can override original files.
Correct solution is:
- go to the directory with necessary files, and then create acrive
cd /var/
tar -cxf /home/user/backup/site.tar.gz www - or tar can do it himself, with option "-C"
tar -cxf /home/user/backup/site.tar.gz -C /var/ www
No comments:
Post a Comment