Extract backup_files.tgz on Centos 6.2 to a directory
Hello
I was login to ssh and from inside the directory i was run this: Code:
tar -zcf backup_files.tgz /home/nginx/domains/mydomain.com/public/ Now from home directory how can i extract all files and folders and overwrite the contents back to the folder public ?: Code:
/home/nginx/domains/mydomain.com/public/ Thank you p.s: I was try from home directory this: Code:
tar xvf backup_files.tgz -C /home/nginx/domains/mydomain.com/public/ Code:
/home/nginx/domains/mydomain.com/public//home/nginx/domains/mydomain.com/public/myfileshere |
Hi,
Assuming that "/home/nginx/domains/mydomain.com/public/" was all there is in the archive, then change your dir to / and execute tar xvf backup_files.tgz it will extract from archive relative to your current working dir / (and if the archive contents were home/nginx/domains/mydomain.com/public/ it will overwrite everything in there with files from archive) or you can go to "/home/nginx/domains/mydomain.com/public//home/nginx/domains/mydomain.com/public/myfileshere" directory and copy everything from this folder to your 'original' where it should be: Code:
# /home/nginx/domains/mydomain.com/public//home/nginx/domains/mydomain.com/public/myfileshere $> cp -v * /home/nginx/domains/mydomain.com/public/ |
Quote:
and if i go to another path that the file backup_files.tgz is not there how it will work? Thank you |
well
how do you change the working directory is a simple command: Code:
# cd / Code:
[server@/]# tar xzvf /path/to/backup_files.tgz |
The last command is:
Quote:
Quote:
Thank you |
this is right:
Code:
tar xzvf /path/to/backup_files.tgz |
All times are GMT -5. The time now is 07:25 AM. |