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: 8271
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: 35815
Joined: Sun Jun 16, 2013 11:19 pm
Location: 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: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
piglet
Posts: 903
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”