skip to Main Content

Due to the way the Plesk Extension on my web server works, I am trying to write a shell command that fires after a deployment. This simply needs to copy the contents of one folder to another.

Currently, I am using this:

cp -r /deployed-site/public/ /httpdocs/

However, this only seems to work if the destination folder is empty. Every time a deployment occurs, I want the contents of the first folder copied and pasted into the second?

2

Answers


  1. I would say it’s better to clean the destination folder before copying files:

    rm -rf /httpdocs
    cp -r /deployed-site/public/ /httpdocs/ 
    
    Login or Signup to reply.
  2. I keep original build code inside a password protected folder build-src

    Then I use :

    rm -rf /httpdocs

    cp -r /httpdocs/build-src /httpdocs/

    I am using this on Plesk remote repository in Deploy Actions

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search