soef / iobroker.js2fs

replicate ioBroker scripts to files
MIT License
6 stars 0 forks source link

Add option to sync both directions by checking file modification time against object lastchange?! #3

Closed Apollon77 closed 7 years ago

Apollon77 commented 7 years ago

Currently the adapter sync from ioBroker to filesystem once on startup and would overwrite all local changes. Would it be possible to check the file modification time of existing files against the mtime from the script object and decide then which direction to sync?

With this it would allow "offline" edit possibilities or such.

soef commented 7 years ago

You are partly right. It is missing the transmission offline, locally changed files to the host. But no local files are overwritten that are newer than on the server.

I will do this in the next few days.

Apollon77 commented 7 years ago

to be honest ... I have it nearly ready ... should I add it to the pull-request ?!

Apollon77 commented 7 years ago

If you want to have a look: https://travis-ci.org/Apollon77/iobroker.js2fs/jobs/268101416 ... one thing left but then I would have it ready

Apollon77 commented 7 years ago

So this is also done in my branch https://github.com/Apollon77/iobroker.js2fs/tree/initSync. See also enhanced testing: https://travis-ci.org/Apollon77/iobroker.js2fs/builds/268163951 (WIndows/Mac testing currently needs a lot f time, so will check that tomorrow, Linux is green). I need to remove some of the logging that was needed to dig into some mysterious stuff, but now solved. Should I merge it into #2 PR? Or what you think?