tagtime / TagTime

Stochastic Time Tracking for Space Cadets
http://tagti.me
Other
367 stars 51 forks source link

Remote log sync (WIP) #69

Open cincodenada opened 7 years ago

cincodenada commented 7 years ago

This is a WIP, but I'm dogfooding it right now. Currently disabled by default, activates once you fill in $remote_id in settings. Throwing up this PR cause it's in MVP stage and thus good enough for some preliminary feedback.

So what's it do? Well, with the (rather generous) assumption that you have somewhere you can scp to, this implements a very basic remote-sync and backup capability for TagTime logs. I added two extra bits into launch.pl (with concordant additions to settings.pl) that accomplish the following:

I'll find out soon enough (and let y'all know) if I've missed anything obvious, but I believe this should accomplish my goal of being able to hop between computers without any manual logfiddling, and as a bonus, would even automatically recover from your log (or TagTime folder) somehow being wiped.

There's a small gotcha currently: if you are on computer A, leave it running, switch to computer B, answer some pings, and then return to A, you have to kill the politely-waiting launch.pl on A, lest it upload its stale log after you close the editor. I may add further checks to avoid this, but killing launch.pl is easy enough for me as of now. If you turn off/sleep A, there's nothing to worry about, as it will pull the updated logs when it wakes back up.

Obviously, caveat emptor, make sure you don't upload your logs to publicly-accessible places if you don't want to, I tried to make it as non-destructive as possible but I'm not responsible if it eats your logs and your mother's logs, etc etc.

Insti commented 7 years ago

Nice.

dreeves commented 4 years ago

Thanks so much for writing this, @cincodenada! If it's been working nicely for you for the past month I'm sold on merging it!