Raspberry Pi-rsync (synchronous)
You can use rsync to synchronize folders between different computers. You may want to transfer a file from your desktop computer or laptop to your Raspberry Pi and keep the file updated. Or, you want to automatically transfer the photos taken by Raspberry Pi to your computer.
Using SSH-based rsync allows you to automatically transfer files to your computer.
The following example sets the photo folder on your Raspberry Pi to automatically synchronize to your computer:
Create a directory named camera on your computer:
Mkdir camera
Log on to Raspberry Pi to run
Hostname-ICommand to view the IP address of Raspberry Pi. In this example, Raspberry Pi has created a scheduled task, which takes a picture every minute and uses a timestamp to save the photo to the local camera directory on the SD card.
Run the following command on your computer (replace it with your own Raspberry Pi IP address ):
Rsync-avz-e ssh pi@192.168.1.10: camera/
This command will copy all files from the Raspberry Pi's camera folder to your computer's camera directory.
To maintain folder synchronization, run this command in cron.
Address: http://www.raspberrypi.org/documentation/remote-access/ssh/rsync.md