문제

How can I copy a folder and its contents (folders inside too), from my local machine to a remote machine using SCP.

I want to copy:

/wp-content

to my remote server, but wp-content does not exist there.

도움이 되었습니까?

해결책

I would tar the folder first and then send over scp

first tar

tar -zcvf wp-content.tar.gz ./wp-content

then send over scp

scp ./wp-content.tar.gz your_username@remotehost.com:/some/remote/directory

then login to the remote machine

ssh your_username@remotehost.com

Navigate to the directory and untar

cd /some/remote/directory
tar -xzvf wp-content.tar.gz ./

다른 팁

rsync -ave ssh /wp-conent user@server_ip:/path/some_non_existing_dir_to_copy/

scp -r wp-content user@remotehost:/destination

scp -r (recursive copy) will create the destination folder if it's not there already.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top