I have a Raspberry Pi for mining. Important informations are written to the file /home/pi/minerlog.log.

Now I have another Raspberry Pi for controlling the miner. I need to access the minerlog file and read its content.

The two Raspberry Pis are in the same network(wifi).

What's the easiest way to read this external file?

  • Please define "best way". Without knowing what you mean by "best way" the question is unanswerable. – joan Jul 12 '18 at 8:29
  • 1
    "easiest" does not help. I might find all sorts of things easy which you would find hard to impossible (and vice versa). – joan Jul 12 '18 at 10:23
  • How about the File Transfer Protocol? – Dmitry Grigoryev Jul 13 '18 at 9:16
  • Already got it thanks. I was thinking about ftp but its difficult to automate the process... I'm using scp now. Much simpler.. – Fipsi Jul 13 '18 at 12:38

There are many ways of allowing access to files from multiple machines. However, you will need the system that owns the files to cooperate.

  1. Copy the files over the network. This is the easiest to say, but might not be the best. But, depending on your needs, it will work and it's not difficult to set up. You could set a cron job that would copy the log every five minutes using "scp" (secure copy - it's available with "ssh").
  2. Store the log files on a shared disk. This is the easiest one to set up and it might cause the least network traffic, depending on how often the logs are written to.
  3. Rsyslogd is designed to handle *nix log files. This is a service, which means you have to configure it. However, it affords one of the best, in my opinion, options: you can put the log file into a database for shared access. This gives you a lot of options to read the data.

I'm sure that there are a lot of other ways to do this, but these three work.

| improve this answer | |
  • command scp helped!! I use it in combination with sshpass to bypass the password with Python. Answer accepted – Fipsi Jul 12 '18 at 10:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.