Hi
Im trying to back up of a directory using tar with --gzip option.
Its on Fedora Core 2 with Plesk 7.5 loaded.
I download the .tgz file to my PC and opened it with 7z and found that it has also compressed the folder hierarchy. So if I extrac it to C:, it'll create a folder called /var/www/vhosts/mydomain.com/httpdcos which is not what I want.
1. I want it such that if I extract it to C:, all files & directories in httdocs gets extracted to C: directly. What option do I need to specify here ?
2. Later I want to extract it to another linux server to a destination folder, how do I so that ?
Code:
tar --create --gzip --file="mydomain.com.tgz" "/var/www/vhosts/mydomain.com/httpdocs/"
One step behind :
Code:
tar --create --gzip --directory="/var/www/vhosts/mydomain.com/" --file="mydomain.com.tgz" "httpdocs/"
creates a .tgz file with root at httpdocs.
But this doest seem to work :
Code:
tar --create --gzip --directory="/var/www/vhosts/mydomain.com/httpdocs/" --file="mydomain.com.tgz" "/"
I think its start from absolute
/ folder !
Code:
tar: Removing leading `/' from member names
tar: /proc/acpi/event: Cannot open: Device or resource busy
tar: /proc/kcore: Cannot open: Operation not permitted
tar: /proc/2/task/2/exe: Cannot readlink: No such file or directory
tar: /proc/2/exe: Cannot readlink: No such file or directory
tar: /proc/3/task/3/exe: Cannot readlink: No such file or directory
tar: /proc/3/exe: Cannot readlink: No such file or directory
tar: /proc/4/task/4/exe: Cannot readlink: No such file or directory
tar: /proc/4/exe: Cannot readlink: No such file or directory
tar: /proc/5/task/5/exe: Cannot readlink: No such file or directory
tar: /proc/5/exe: Cannot readlink: No such file or directory
tar: /proc/17/task/17/exe: Cannot readlink: No such file or directory
tar: /proc/17/exe: Cannot readlink: No such file or directory
tar: /proc/98/task/98/exe: Cannot readlink: No such file or directory
tar: /proc/98/exe: Cannot readlink: No such file or directory
tar: /proc/106/task/106/exe: Cannot readlink: No such file or directory
tar: /proc/106/exe: Cannot readlink: No such file or directory
tar: /proc/167/task/167/exe: Cannot readlink: No such file or directory
tar: /proc/167/exe: Cannot readlink: No such file or directory
tar: /proc/166/task/166/exe: Cannot readlink: No such file or directory
tar: /proc/166/exe: Cannot readlink: No such file or directory
tar: /proc/260/task/260/exe: Cannot readlink: No such file or directory
tar: /proc/260/exe: Cannot readlink: No such file or directory
tar: /proc/447/task/447/exe: Cannot readlink: No such file or directory
tar: /proc/447/exe: Cannot readlink: No such file or directory
tar: /proc/452/task/452/exe: Cannot readlink: No such file or directory
tar: /proc/452/exe: Cannot readlink: No such file or directory
tar: /proc/453/task/453/exe: Cannot readlink: No such file or directory
tar: /proc/453/exe: Cannot readlink: No such file or directory
tar: /proc/468/task/468/exe: Cannot readlink: No such file or directory
tar: /proc/468/exe: Cannot readlink: No such file or directory
tar: /proc/1559/task/1559/exe: Cannot readlink: No such file or directory
tar: /proc/1559/exe: Cannot readlink: No such file or directory
tar: /proc/6599/task/6599/exe: Cannot readlink: No such file or directory
tar: /proc/6599/exe: Cannot readlink: No such file or directory
So how to get to my last step ?
(I do want sub-directories of httpdocs though)
Thanks