How to untar and overwrite existing files

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

How to untar and overwrite existing files

Post by cnymike »

What is the proper commands to untar and overwrite files within a directory?

When I go to my cmsms installation root and upload the tar.gz file and then issue the command

Code: Select all

tar -zxvf cmsmadesimple-1.1.tar.gz
I end up with a new directory named "cmsmadesimple-1.1" in which are the untared files. but I don't want to create a new directory, I want the tar file to expand and overwrite the existing files. what am I doing wrong?

I am trying to "fix" an upgrade problem I'm having moving from 1.0.8 to 1.1

I had tried to simply "move" the unzipped files over my existing installation but this resulted in a fatal error which I have another thread on. I'm trying to rectify that by reinstalling over everything. The problem with manually overwriting each file was that when trying to overwrite a directory, i keep getting an error from my ftp client (cyberduck) that the directory is not empty and cannot be renamed.
Last edited by cnymike on Wed Jul 18, 2007 12:01 am, edited 1 time in total.
Pierre M.

Re: How to untar and overwrite existing files

Post by Pierre M. »

Hello,

here is an ugly hack, NO WARRANTY, use it only if you understand it :

Code: Select all

mv cmsmsfolder cmsmsfolder.old
tar -zxf cmsms-1.1.tar.gz
mv cmsms-1.1 cmsmsfolder
tar -zcf my.tar.gz cmsmsfolder
rm -rf cmsmsfolder
mv cmsmsfolder.old cmsmsfolder
tar -zxf my.tar.gz (should expand overwriting cmsmsfolder)
Pierre M.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to untar and overwrite existing files

Post by calguy1000 »

Here's some simpler commands.

This WILL overwrite all of your files as it expands the cmsmadesimple-1.1.tar.gz directory into tar first and then copies the files overtop of your existing ones.

Code: Select all

cd /tmp
tar zxvf cmsmadesimple-1.1.tar.gz
cd cmsmadesimple-1.1
tar cf - . | ( cd <my installation directory> && tar xvf - )
Again, no warantees implied or expressed, use at your own risk.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: How to untar and overwrite existing files

Post by cnymike »

Thanks guys. Torty, in this thread http://forum.cmsmadesimple.org/index.ph ... 566.0.html offered a suggestion and here is what I did...

I uploaded the cmsmadesimple-1.1 tar.gz file into my public_html directory.
I issued this command to untar it

Code: Select all

tar -zxvf cmsmadesimple-1.1.tar.gz
After untarring the file, i used the following command....

Code: Select all

cp -R cmsmadesimple-1.1/* stjameschurch
This recursively copied and overwrote all the files in the installation I was trying to upgrade.

I'm not much of  Unix or terminal kind of guy so this was hard for me to grasp but it seemed to work, my installation is back up and running with no more fatal errors. Yeah!
Locked

Return to “[locked] Installation, Setup and Upgrade”