Venkateshtata
Posts: 1
Joined: Thu Sep 28, 2017 10:35 am

how can a raspberry pi run a script thaat continuously reads a single file for changes and saves on itself

Thu Sep 28, 2017 10:45 am

I need to write a python script on raspberry pi which can continuously keep monitoring a file of an other PC and write the changes of that file into itself (or) and save that file locally onto the pi , the file which it reads must be a general text file, .csv, etc.. Can anyone please help me out with this please ? Is there any way i can do that ?

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: how can a raspberry pi run a script thaat continuously reads a single file for changes and saves on itself

Thu Sep 28, 2017 12:00 pm

Welcome to the Raspberry Pi forums.

Yes, what you ask is certainly possible.

How far have you got? Where do you get stuck?

If it were my project I would write it to use a file stored in the local RPi in the first instance, and then look into extending that solution to work with a file accessed remotely.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: how can a raspberry pi run a script thaat continuously reads a single file for changes and saves on itself

Thu Sep 28, 2017 1:56 pm

Search Google for "Gamin".
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
piglet
Posts: 915
Joined: Sat Aug 27, 2011 1:16 pm

Re: how can a raspberry pi run a script thaat continuously reads a single file for changes and saves on itself

Thu Sep 28, 2017 2:23 pm

Or alternatively periodically running "rsync" may do it for you, particularly if you don't necessarily know what files may be generated that you want to keep a copy of on the pi.

Return to “General discussion”