Skip to content

101. Copying files off the Raspberry Pi

vtjeng edited this page Oct 25, 2015 · 3 revisions

You've capture a bunch of images on your Raspberry Pi, and now you want to copy them off the Pi and view them. An scp GUI might fit your needs, but if you're trying to copy large batches of photos, rsync provides a neat alternative that avoids having to click around.

Setup

Firstly, we need to generate an SSH key, consisting of an identification and a public key.

Change the permissions (chmod) on your identification (the generic name will be id_rsa) to 600. Help if you can't do it.

Add your public key (generic name id_rsa.pub) to the .ssh/authorized_keys file in your Raspberry Pi.

Whenever you need to copy

Run the following command. Don't miss out on the * - it specifies that you want to copy all the files contained in that directory!

rsync --remove-source-files -ut -e 'ssh -i /path/to/identification' --progress user_name@ip_address:/path/to/source/directory/* '/path/to/destination/directory/'