SSH Recording Project

I’m starting a project that needs to connect to a device via SSH, save the logs from the attached device and then periodic send them via WiFi to the Google Storage bucket. I am planning on using WiFi- Connect with this project.

Here are my questions:

  1. I’m not a Linux dev (I’m learning), is better to write a program that does this or is there a way to do this via command line tools and a cron job?
  2. If a program is the best path forward, how does that program know if the WiFi connection is available?
  3. Can wifi-connect be programmed with more than one SSID so that it connects to different networks when they available?

Just looking for tips on how to do this.


Hi there, WiFi Connect only supports a single AP at any give time, though you can change it through environment variables. Once you have connectivity established, collecting logs and shipping them is probably best done on some sort of timed event loop. You could build a very simple container with crond running for a PoC. You will still need to write some code to ssh in and collect logs from other devices. This would require managing ssh keys, passwords, etc. which all need to be considered. There are always a number of different ways to solve these sorts of problems, picking the right one is really down to the specific skills at hand, reliability requirement, etc. One thing I find that works well, is to prototype something first, using the simplest use case and then see how it performs. Hope this helps.

… of course the other option would be to run balenaOS on all of these devices, so you would have the logs already in one place on the balenaCloud dashboard. then you can use our API/SDK to manipulate/parse them.