forked from raspberrypi/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05e2460
commit dd78860
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# rsync | ||
|
||
You can use the tool `rsync` to syncronise folders between computers. You might want to transfer some files from your desktop computer or laptop to your Pi, and for them to be kept up to date, or you might want the pictures taken by your Pi transferred to your computer automatically. | ||
|
||
Using `rsync` over SSH allows you to transfer files to your computer automatically. | ||
|
||
Here is an example of setting up the sync of a folder of pictures on your Pi to your computer: | ||
|
||
On your computer, create a folder called `camera`: | ||
|
||
``` | ||
mkdir camera | ||
``` | ||
|
||
Look up the Pi's IP address by logging in to it and running `hostname -I`. In this example the Pi is creating a timelapse by capturing a photo every minute and saving the picture with a timestamp in the local folder `camera` on its SD card. | ||
|
||
Now run the following command (replacing your own Pi's IP address): | ||
|
||
``` | ||
rsync -avz -e ssh [email protected]:camera/ camera/ | ||
``` | ||
|
||
This will copy all files from the Pi's `camera` folder to your computer's new `camera` folder. | ||
|
||
In order to keep the folders in sync, run this command in [cron](../../linux/cron.md). |