Jump to content

extract tar.gz to folder with certain name?


ChrisMartino

Recommended Posts

As far as I know you'll need to create the directory first.

 

mkdir ../foo ; tar xvpf tarfile.tar.gz -C ../foo

 

Thats brilliant, One problem though, Inside the .tar.gz there is a file, THEN the files that i need to be extracted into the folder that we made, Is there any way to just get the contents of the folder 'ivmpsvr' from within the .tar.gz?, Thanks.

just use

mkdir ../foo ; tar xvpf tarfile.tar.gz ivmpsvr -C ../foo

 

It doesn't extract it now :/

 

$ssh->exec('cd /home/'.$ClientFolder.' && mkdir '.$ServerID.' && cd /home/Games && tar xvpf '.$game.'.tar.gz ivmpsvr -C ../'.$ClientFolder.'/'.$ServerID);

just use

mkdir ../foo ; tar xvpf tarfile.tar.gz ivmpsvr -C ../foo

 

It doesn't extract it now :/

 

$ssh->exec('cd /home/'.$ClientFolder.' && mkdir '.$ServerID.' && cd /home/Games && tar xvpf '.$game.'.tar.gz ivmpsvr -C ../'.$ClientFolder.'/'.$ServerID);

 

is the ivmpsvr directory in the root of the archive? If not you will need to specify the path to it. You may need to do something like:

$ssh->exec('cd /home/'.$ClientFolder.' && mkdir '.$ServerID.' && cd /home/Games && tar xvpf '.$game.'.tar.gz '.$game.'/ivmpsvr -C ../'.$ClientFolder.'/'.$ServerID);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.