Keeping 'order' without RTC.

When you transfer a dir of script/s & data-files to rPi from your PC, via USBstik, there's a problem, since the rPi has no RealTimeClock.

So the important abilty to 'evaluate' files by their recentcy is lost. It's a universal truth that you'll want to get the most-recent cup-of-coffee and not the 17th most-recent that you put-down. That's why stacks are used.

What algorithm do you use to solve this problem?

==TIA.

Reply to
not.socialnetwork
Loading thread data ...

md5sum

--
Robert Heller             -- 978-544-6933 
Deepwoods Software        -- Custom Software Services 
http://www.deepsoft.com/  -- Linux Administration Services 
heller@deepsoft.com       -- Webhosting Services
Reply to
Robert Heller

I don't know why you relate that to not having a realtime clock.

First, you can set the time and keep it correct on the Pi using NTP. Second, you can copy files and retain their original date.

(e.g. using the -p or -a flag of cp)

Reply to
Rob

I keep files that have multiple version in a version control system.

--
http://www.greenend.org.uk/rjk/
Reply to
Richard Kettlewell

Or using rsync or using tar.

>
--
Robert Heller             -- 978-544-6933 
Deepwoods Software        -- Custom Software Services 
http://www.deepsoft.com/  -- Linux Administration Services 
heller@deepsoft.com       -- Webhosting Services
Reply to
Robert Heller

Doesn't work so good for binary files

Reply to
Baho Utot

Sure it does. They might not be diffs available, but it does keep track of multiple versions.

--
Robert Heller             -- 978-544-6933 
Deepwoods Software        -- Custom Software Services 
http://www.deepsoft.com/  -- Linux Administration Services 
heller@deepsoft.com       -- Webhosting Services
Reply to
Robert Heller

They don?t seem to be causing me any trouble.

--
http://www.greenend.org.uk/rjk/
Reply to
Richard Kettlewell

chrony. ntp would do as well (assuming of course that you are on the net, or have a gps timing receiver plugged in). Otherwise you can set the time by hand with chrony, or even with just adjtimex.

Reply to
William Unruh

It is the time stamp on the file which tells you what is the most recent version, is I presume what he means. And it is the RTC which linux uses to set the current time on bootup.

Or use rsync. Of course the rPi finding files that are 45 years in the future, according to the current time on the machine could well confuse the operating system.

Reply to
William Unruh

Normally when you copy a directory via USBstick the timestamps will be transferred with the copy and the local time on the system is not relevant.

No, that does not matter to rsync. It only compares filetimes, not the system time.

Reply to
Rob

But rsync sets the time and the permissions on the transfered file to be the same as on the source file.

It is the operating system (not rsync) that may have trouble if it finds files 45 years in the future, because it thinks it is still 1970.

Reply to
William Unruh

I use NTP so that my Raspberry Pi cards keep the correct time. I believe you can buy an RTC card for the RPi as well.

--
Cheers, 
David 
Web: http://www.satsignal.eu
Reply to
David Taylor

Most version control systems simply store the entire binary file every time so one is no better off if you simply create a directory to hold all the different binary files.

Reply to
Baho Utot
[putolin]

You mean it's not Jan 01, 1970? I wonder where have I've been.

Reply to
Baho Utot

It sounds like you think the only relevant issue is storage space.

--
http://www.greenend.org.uk/rjk/
Reply to
Richard Kettlewell

The operating system does not care about that.

The only problem that may occur is that one of those files is modified, then gets an old modification time, then copied back onto the USBstick and the user is confused to see such an old file on the stick, or it may fail to be copied back to the other system when "copy only newer files" is used as a synchronization method (i.e. not the rsync default)

But those issues can be easily avoided using NTP. I think the Pi image comes with ntpd and pool.ntp.org by default, but I always change that to use my own NTP servers.

Reply to
Rob

The problem with NTP is you need a network connection and our troll (remember he's the guy asking the bizarre questions people can't help themselves from answering) doesn't have an internet connection. Except when he's trolling, then his net connection is real peachy.

Reply to
mm0fmf

He does not need an Internet connection. The machine he is transferring files to/from can provide NTP service.

--
John Hasler  
jhasler@newsguy.com 
Dancing Horse Hill 
Elmwood, WI USA
Reply to
John Hasler

No not really, as someone that has extensive Solidworks files/models/drawings etc I find that vcs (version control systems) very in-appropriate for the job. Now text files as in *.c *.h etc I would use vcs.

Reply to
Baho Utot

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.