tags:

views:

58

answers:

1

Hi,

I am creating a back up system for a content management system. This backup grabs a copy of the database and all of the files in a 'userfiles' folder, tars it up and allows the client to download it.

This works fine.

I am having issues with importing the file. The files in tarball keep their location. On my Mac I am using XAMPP for local testing. As a result I am getting a file path like this in the tarball.

/Applications/XAMPP/xampp_files/htdocs/work/cms/userfiles/..

However on Linux I am getting a mysterious folder wrapping this. Please note [client] means

/[client] 2/data/clients/[client]/userfiles/

The '[client] 2' folder doesn't exist. Its a bit of a mystery as to why it is there. I am using the PEAR Tar library.

Instead of playing around with the Tar library is there a way to extract the data folder from the '[client] 2' directory so I am just left with

/data/client/[client]/userfiles/

This will then allow me to extract and overwrite the files into the correct directory.

Thanks in advance for any advice given.

+1  A: 

i think there is an commandline option for tar to start extracting at a specified folder man tar

tar -K, --starting-file F begin at file F in the archive

Christoferw