Pregunta

I've had a look on google and here on stack but can't find a good example on how to do this.

All I basically want to do is SSH into a server copy all the site files and paste them into a folder on my computer?

I normally use git but this is an old site which has not been setup with git so I just wanted to know a quick way to copy from the server as FTP sucks!

A simple process with commands for terminal would be great!

¿Fue útil?

Solución 2

ssh USER@SERVER "tar zcvf - /DUMP_DIR" | cat > /OUT_DIR/FILE_NAME_OF_ARCH

or

(rsync -avz --delete /DUMP_DIR USER@SERVER:/OUT_DIR &)

Otros consejos

Check out rsync. It has the capability to operate over ssh. You might also want to look into ssh aliases (which it also honors) when copying files over, and it's what git uses to only sync the differences between two repositories.

The advantage of rsync over SCP or SFTP is that it can resume download if interrupted, takes little bandwidth to sync since it sends change sets instead of entire files (unless the file doesn't yet exist on one side), and can do one- or two-way sync depending on your preference.

Look at SCP.

scp username@remotehost.com:/directoryname/* /some/local/directory

Use scp

scp -P 2222 json-serde-1.1.8-SNAPSHOT-jar-with-dependencies.jar root@127.0.0.1:

For Example.

Hope that helps!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top