Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy Digital Ocean app folder to local machine?

I'd like to copy the contents of my app folder from my Digital Ocean droplet to my local machine, because I've accidentally removed the app from my local machine and need it back.

I've tried the following, as an example,

scp -r [email protected]:/PATH-TO-APP 

Which gave me the following,

usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2

How do I copy the app to my local machine? I need to set a destination for scp to work, what destination can i set so it copys to local machine, /User/sites directory?

like image 862
Chris Web Avatar asked Apr 25 '16 03:04

Chris Web


Video Answer


1 Answers

Try:

scp -r [email protected]:/PATH-TO-APP .

This should copy it to the current directory. You could also do:

scp -r [email protected]:/PATH-TO-APP ~/project

To copy it to a specific folder.

Two tangential observations, by the way:

  1. Stop using your DigitalOcean droplet as root. You should make your own user account on the Droplet and set up SSH authentication.
  2. You should be using Git to keep the remote copy of your project and your local copy in sync, not scp (granted, this may be a strange case, but just making sure you're aware).
like image 168
Steven Petryk Avatar answered Sep 28 '22 06:09

Steven Petryk