Skip to main content
added 10 characters in body
Source Link

I'm copying a website from remote server to another and I have

SOURCE SERVER /var/www/vhosts/namesiteA.com /FolderA /FolderB   DESTINATION SERVER  /var/www/vhosts/namesiteB.com    

After running the following bash:

#!/bin/bash SOURCE="[email protected]:/var/www/vhosts/namesiteA.com/" DESTINATION="/var/www/vhosts/namesiteB.com/" sshpass -p "<source_server_pass>" scp -p -r "$SOURCE" "$DESTINATION" 

This works fine, but I expect:

DESTINATION SERVER /var/www/vhosts/namesiteB.com /FolderA /FolderB instead I get: /var/www/vhosts/namesiteB.com /namesiteA.com /FolderA /FolderB 

I'm copying a website from remote server to another and I have

SOURCE SERVER /var/www/vhosts/namesiteA.com /FolderA /FolderB DESTINATION SERVER  /var/www/vhosts/namesiteB.com 

After running the following bash:

#!/bin/bash SOURCE="[email protected]:/var/www/vhosts/namesiteA.com/" DESTINATION="/var/www/vhosts/namesiteB.com/" sshpass -p "<source_server_pass>" scp -p -r "$SOURCE" "$DESTINATION" 

This works, but I expect:

DESTINATION SERVER /var/www/vhosts/namesiteB.com /FolderA /FolderB instead I get: /var/www/vhosts/namesiteB.com /namesiteA.com /FolderA /FolderB 

I'm copying a website from remote server to another and I have

SOURCE SERVER /var/www/vhosts/namesiteA.com /FolderA /FolderB   DESTINATION SERVER /var/www/vhosts/namesiteB.com    

After running the following bash:

#!/bin/bash SOURCE="[email protected]:/var/www/vhosts/namesiteA.com/" DESTINATION="/var/www/vhosts/namesiteB.com/" sshpass -p "<source_server_pass>" scp -p -r "$SOURCE" "$DESTINATION" 

works fine, but I expect:

DESTINATION SERVER /var/www/vhosts/namesiteB.com /FolderA /FolderB instead I get: /var/www/vhosts/namesiteB.com /namesiteA.com /FolderA /FolderB 
Source Link

Wrong scp destination path

I'm copying a website from remote server to another and I have

SOURCE SERVER /var/www/vhosts/namesiteA.com /FolderA /FolderB DESTINATION SERVER /var/www/vhosts/namesiteB.com 

After running the following bash:

#!/bin/bash SOURCE="[email protected]:/var/www/vhosts/namesiteA.com/" DESTINATION="/var/www/vhosts/namesiteB.com/" sshpass -p "<source_server_pass>" scp -p -r "$SOURCE" "$DESTINATION" 

This works, but I expect:

DESTINATION SERVER /var/www/vhosts/namesiteB.com /FolderA /FolderB instead I get: /var/www/vhosts/namesiteB.com /namesiteA.com /FolderA /FolderB