If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Linux/Unix Server / Removing a directory and copying its files only

Removing a directory and copying its files only

Started by ckosloff on 4 Sep 2022, 11:18 PM · Views: 3,178

Results 1 to 12 of 12
4 Sep 2022, 11:18 PM
#1
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #1 by ckosloff

I am trying to follow instructions in Manual but they are outdated and refer to File Manager.
As a proud Linux user I wouldn't touch that stuff with a ten foot pole.
But I messed up because the author recommends to change files into a custom directory to void customization being broken by an update to /includes/templates/responsive_classic.
So I decided to create a directory called mein and copying files from responsive_classic to mein.
But I ended up with a copy of responsive_classic directory inside mein.
There are several solutions to this:

  1. remove the responsive directory inside mein and then copy files from responsive into it
  2. Rename the responsive directory to mein using the mv command and then create an empty responsive classic at /includes/templates, so the update will update that one, and leave mein alone, which will be set as default in configuration settings.
    Problem with 1. is that I get error saying that directory is not empty, I understand that is a syntax error form my part.
    The** most important thing** is that now I think that author's advice is wrong because I might be able to save my customizations but I might lose important file updates to the responsive template.
    Please help.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

5 Sep 2022, 10:24 AM
#2
earp avatar

earp

New Zenner

Join Date:
Dec 2020
Location:
Ohio
Posts:
30
Plugin Contributions:
0

Post #2 by earp

I'm not exactly sure what you're trying to do, but it sounds like you want to create a custom template based on the responsive_classic template. This excellent plugin makes that easy - https://www.zen-cart.com/downloads.php?do=file&id=2087. I don't understand your Linux comment. The instructions you read probably are referring to the CPanel File Manager, which is usable with any browser, regardless of OS.

5 Sep 2022, 11:07 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,762
Plugin Contributions:
56

Post #3 by swguy

The Unix "cp" command is easy to mess up. When you say,

So I decided to create a directory called mein and copying files from responsive_classic to mein.
But I ended up with a copy of responsive_classic directory inside mein.

This tells me you did (something like)

mkdir mein
cp -r responsive_classic mein

This will copy the resposive classic folder into mein.

Clean up:
rm -rf mein
cp -r responsive_classic mein

This creates a new folder called mein with the contents of responsive classic.

If you want to create the folder first then copy, you can do this, but the syntax is different from what you did:

mkdir mein
cp -r responsive_classic/* mein/

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

5 Sep 2022, 4:32 PM
#4
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #4 by ckosloff

Great post, thank you.
What do you think of author's (Richard Underwood) advice to create a different directory so customizations won't be overwritten by updates?
I think I will delete the mein directory and keep the defaults even at the cost of losing customizations. I prefer to keep updates to files.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

5 Sep 2022, 5:10 PM
#5
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #5 by ckosloff

earp:

I'm not exactly sure what you're trying to do, but it sounds like you want to create a custom template based on the responsive_classic template. This excellent plugin makes that easy - https://www.zen-cart.com/downloads.php?do=file&id=2087. I don't understand your Linux comment. The instructions you read probably are referring to the CPanel File Manager, which is usable with any browser, regardless of OS.

I don't know anything about CPanel and wish to stay in blissful ignorance of it, since I only know it is unnecessary if you use Linux, same as so many things that books on ZenCart state and even tutorials on this website. I don't think plugin is necessary but thanks anyway. I am a software minimalist and use only what I need, don't want to cram my computers or my phone with apps.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

5 Sep 2022, 5:39 PM
#6
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #6 by ckosloff

ckosloff:

I am trying to follow instructions in Manual but they are outdated and refer to File Manager.
As a proud Linux user I wouldn't touch that stuff with a ten foot pole.
But I messed up because the author recommends to change files into a custom directory to void customization being broken by an update to /includes/templates/responsive_classic.
So I decided to create a directory called mein and copying files from responsive_classic to mein.
But I ended up with a copy of responsive_classic directory inside mein.
There are several solutions to this:

  1. remove the responsive directory inside mein and then copy files from responsive into it
  2. Rename the responsive directory to mein using the mv command and then create an empty responsive classic at /includes/templates, so the update will update that one, and leave mein alone, which will be set as default in configuration settings.
    Problem with 1. is that I get error saying that directory is not empty, I understand that is a syntax error form my part.
    The** most important thing** is that now I think that author's advice is wrong because I might be able to save my customizations but I might lose important file updates to the responsive template.
    Please help.

You are right about what I did.
Now I am about to clean up the extra directory that I created and stay with the default template.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

5 Sep 2022, 5:54 PM
#7
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #7 by ckosloff

swguy:

The Unix "cp" command is easy to mess up. When you say,

So I decided to create a directory called mein and copying files from responsive_classic to mein.
But I ended up with a copy of responsive_classic directory inside mein.

This tells me you did (something like)

mkdir mein
cp -r responsive_classic mein

This will copy the resposive classic folder into mein.

Clean up:
rm -rf mein
cp -r responsive_classic mein

This creates a new folder called mein with the contents of responsive classic.

If you want to create the folder first then copy, you can do this, but the syntax is different from what you did:

mkdir mein
cp -r responsive_classic/* mein/

Sorry about my mistake.
My last post was intended for you, but I quoted myself, should stop playing chess online until 3am. I am not fully awake.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

5 Sep 2022, 5:59 PM
#8
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #8 by ckosloff

earp:

I'm not exactly sure what you're trying to do, but it sounds like you want to create a custom template based on the responsive_classic template. This excellent plugin makes that easy - https://www.zen-cart.com/downloads.php?do=file&id=2087. I don't understand your Linux comment. The instructions you read probably are referring to the CPanel File Manager, which is usable with any browser, regardless of OS.

Thanks for tip on module, but I don't think that I will use it.
Regarding CPanel I don't know anything about it, except that it is unnecessary for a Linux user like so many things in Zen Cart books.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

5 Sep 2022, 10:32 PM
#9
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,762
Plugin Contributions:
56

Post #9 by swguy

What do you think of author's (Richard Underwood) advice to create a different directory so customizations won't be overwritten by updates?

I don't know who he is or what you are referring to. But I would encourage you to read the official help pages on this.
Yes, you want to use template overrides.

https://docs.zen-cart.com/user/template/template_overrides/

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

6 Sep 2022, 1:59 AM
#10
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #10 by ckosloff

swguy:

What do you think of author's (Richard Underwood) advice to create a different directory so customizations won't be overwritten by updates?

I don't know who he is or what you are referring to. But I would encourage you to read the official help pages on this.
Yes, you want to use template overrides.

https://docs.zen-cart.com/user/template/template_overrides/

Richard Underwood is the author of a Zen Cart Manual, there are more than one, my choice is the one by Go Koon Hoek, that is how I learned Zen Cart a long time ago, forgot a lot.
Thanks for the document I will implement overrides, but I have a doubt my overrides cannot have the same name as the downloaded files, so if an update comes like 1.5.8 it will load different files that will not go to my overriden folders, so I will miss the update.
Am I right, what is the procedure then, compare files and chose?

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

6 Sep 2022, 3:22 AM
#11
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,908
Plugin Contributions:
23

Post #11 by dbltoe

The whole idea about overrides is that they are not overwritten on update. Thus preserving them for use later.

It's old but it still works well. Get a copy of lat9's cheatsheet and follow it when making changes. You'll thank me later. :P

https://www.zen-cart.com/downloads.php?do=file&id=1393

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

6 Sep 2022, 3:38 PM
#12
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Post #12 by ckosloff

dbltoe:

The whole idea about overrides is that they are not overwritten on update. Thus preserving them for use later.

It's old but it still works well. Get a copy of lat9's cheatsheet and follow it when making changes. You'll thank me later. :P

https://www.zen-cart.com/downloads.php?do=file&id=1393

I can thank you now, I will compare that file with the official one which swguy sent in this thread.
My only problem is that it is old as I surmised and to restore customizations wouldn't be that difficult.
I will give it a sink.
Thank you,

[argentiniansupermarket.com

](http://argentiniansupermarket.com)