Scp Upload/Download

Download/Upload from a remote server.

scp -r <source> <destination>
Bash

Upload

scp -r folder username@exemple.com:/path/to/foo
Bash

Download

scp -r username@exemple.com:/path/to/foo folder
Bash

Exemple

File/folder with espace

scp -r username@exemple.com:"'/path/to/folder with espace'" folder
Bash

Use fd & fzf for upload file

scp "$(fd | fzf)" username@exemple.com:/path/to/folder
Bash

Select download

#!/bin/sh
select brand in "Kaamelott Livre I" "Kaamelott Livre II" "Kaamelott Livre III" "Kaamelott Livre IV" "Kaamelott Livre V" "Kaamelott Livre VI"
do
echo "You have chosen $brand download"
    case $brand in
        "Kaamelott Livre I")
            scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/Livre I'" /Users/slote/Desktop/Kaamelott
        ;;
        "Kaamelott Livre II")
            scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/Livre II'" /Users/slote/Desktop/Kaamelott
        ;;
        "Kaamelott Livre III")
            scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/Livre III'" /Users/slote/Desktop/Kaamelott
        ;;
        "Kaamelott Livre IV")
            scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/Livre IV'" /Users/slote/Desktop/Kaamelott
        ;;
        "Kaamelott Livre V")
            scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/Livre V'" /Users/slote/Desktop/Kaamelott
        ;;
        "Kaamelott Livre VI")
            scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/Livre VI'" /Users/slote/Desktop/Kaamelott
        ;;
        *)
            echo "Invalid entry."
        break
        ;;
    esac
done
Bash

Use fzf & xargs for download folder

#!/bin/sh
echo " Livre I\n" "Livre II\n" "Livre III\n" "Livre IV\n" "Livre V\n" "Livre VI" | \
 fzf | \
 xargs -I {} \
 scp -r pi@raspberrypi:"'/mnt/disk1/Movies/[ OxTorrent.com ] Kaamelott/{}'" .
Bash

MarquandT

Ethical Hacker ~ Web Developper ~ File Hosting Provider ~ Crypto Enthusiast ~ Automation Expert Bitcoin donation: 32Uu4NKGnxSPC7UukYXVyRHwbppbQpKVki

1317