Charles Reid
8f2bca5046
|
7 years ago | |
---|---|---|
.gitignore | 8 years ago | |
LICENSE | 7 years ago | |
README.md | 8 years ago | |
check_stunnel_forever_loop.sh | 8 years ago | |
rsync_with_server.sh | 8 years ago | |
rsyncd.conf | 8 years ago | |
setup_rsync.sh | 8 years ago |
README.md
pi-transmission
Scripts for transmission of data from Raspberry Pi to external server. This checks if stunnel is running, and if so, attempts to run rsync to remotely sync the data generated with a remote server.
Note this assumes the existence of a writable directory at /wifi:
mkdir /wifi
chown user:group /wifi
Server: setup rsync confing script
(SERVER ONLY)
This script gets the rsync configuration file in this repo set up on the rsync (and stunnel) server.
The config file specifies the name of the rsync target (pi) and what to do with traffic that is marked for pi.
[remote] $ ./setup_rsync.sh
Now that the rsync configuration has been installed, you can start the rsync service:
[remote] $ sudo service rsync start
Client: check stunnel forever loop
(CLIENT ONLY; this calls the rsync with server script below.)
This script will loop forever and perform the following action: Check if stunnel is running. Try to start it if it is not. Attempt to rsync the wifi data directory with the remote server using the rsync with server script (below).
Take a nap for 5 minutes and try again.
[client] $ ./check_stunnel.sh
If you just want to check if rsync is working, use the script below by itself.
rsync with server
(CLIENT ONLY; this is called by the check stunnel script above)
Once we have rsync all set up, and stunnel is operating, we can route rsync traffic through localhost by just specifying localhost as the rsync target.
Here is a quick test of rsync:
[client] $ rsync -vv localhost:: # just a quick test
and here is the actual command we would run:
[client] $ rsync -vv -aR ${HOME}/wifi localhost::pi # the full monty
That's basically all that this script does.