Skip to content

Instantly share code, notes, and snippets.

@KryptikOne
Last active September 24, 2018 20:58
Show Gist options
  • Select an option

  • Save KryptikOne/4bc40033ca6ee9d9bc44318da0bd5b0c to your computer and use it in GitHub Desktop.

Select an option

Save KryptikOne/4bc40033ca6ee9d9bc44318da0bd5b0c to your computer and use it in GitHub Desktop.

Revisions

  1. KryptikOne revised this gist Sep 24, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions rsync-with-pem.txt
    Original file line number Diff line number Diff line change
    @@ -5,19 +5,19 @@ 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
    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
    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
    rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/some_database_file.sql ~/Downloads/SomeLocalFolder/

    ============================
    LOCAL -> REMOTE
  2. KryptikOne revised this gist Sep 10, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rsync-with-pem.txt
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,4 @@ rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www
    LOCAL -> REMOTE
    ============================

    rsync -avLP ~/Downloads/SomeLocalFolder [email protected]:/var/www/blah/blah/SOME_REMOTE_FOLDER/
    rsync -avLP -e "ssh -i NAME_OF_PEM_FILE.pem" ~/Downloads/SomeLocalFolder [email protected]:/var/www/blah/blah/SOME_REMOTE_FOLDER/
  3. KryptikOne revised this gist Sep 10, 2018. 1 changed file with 13 additions and 3 deletions.
    16 changes: 13 additions & 3 deletions rsync-with-pem.txt
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,26 @@
    ============================
    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 -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/ ~/Downloads/SomeLocalFolder
    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 -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah ~/Downloads/SomeLocalFolder
    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 -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/some_database_file.sql ~/Downloads/SomeLocalFolder
    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 ~/Downloads/SomeLocalFolder [email protected]:/var/www/blah/blah/SOME_REMOTE_FOLDER/
  4. KryptikOne revised this gist Jul 2, 2018. 1 changed file with 15 additions and 3 deletions.
    18 changes: 15 additions & 3 deletions rsync-with-pem.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,16 @@
    rsync -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah ~/Downloads/some_folder
    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 -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/ ~/Downloads/SomeLocalFolder

    If you add the / at the end of the remote path, (/var/www/blah/blah), rsync will grab the contents of the directory
    If you omit the / it will grab the parent folder itself

    Need to grab the parent directory?
    If you omit the / it will grab the parent folder itself
    ===============================================================
    rsync -avL --progress -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 -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah/some_database_file.sql ~/Downloads/SomeLocalFolder
  5. KryptikOne revised this gist Jun 7, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions rsync-with-pem.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    rsync -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah ~/Downloads
    rsync -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah ~/Downloads/some_folder

    if you add a / at the end of the remote path that will grab the contents, otherwise it will grab the parent folder
    If you add the / at the end of the remote path, (/var/www/blah/blah), rsync will grab the contents of the directory
    If you omit the / it will grab the parent folder itself
  6. KryptikOne created this gist Jun 6, 2018.
    3 changes: 3 additions & 0 deletions rsync-with-pem.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    rsync -avL --progress -e "ssh -i NAME_OF_PEM_FILE.pem" [email protected]:/var/www/blah/blah ~/Downloads

    if you add a / at the end of the remote path that will grab the contents, otherwise it will grab the parent folder