Last active
September 24, 2018 20:58
-
-
Save KryptikOne/4bc40033ca6ee9d9bc44318da0bd5b0c to your computer and use it in GitHub Desktop.
RSync with pem file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ============================ | |
| LOCAL <- REMOTE | |
| ============================ | |
| Need to grab the contents of a directory? | |
| If you add the / at the end of the remote path, rsync will grab the contents of the directory | |
| =============================================================== | |
| rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/ ~/Downloads/SomeLocalFolder | |
| Need to grab the parent directory? | |
| If you omit the / it will grab the parent folder itself | |
| =============================================================== | |
| rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah ~/Downloads/SomeLocalFolder | |
| Need to grab a specific file? | |
| Just specify the exact filename and extension and it will grab the file only | |
| =============================================================== | |
| rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/some_database_file.sql ~/Downloads/SomeLocalFolder | |
| ============================ | |
| LOCAL -> REMOTE | |
| ============================ | |
| rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" ~/Downloads/SomeLocalFolder [email protected]:/var/www/blah/blah/SOME_REMOTE_FOLDER/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment