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
I would say it’s better to clean the destination folder before copying files:
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