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:
After any successful launch.pl, TagTime copies its log up to a remote server, tagged with $remote_id, a user-specified machine-specific string to distinguish it from any other instances, so that any instance can access any other instance's log.
Then, when launching, if there's a gap between the last logged ping and now, before filling it in with RETRO, it tries to pull down the latest (by modification time) log from the specified remote server, which was presumably previously uploaded by a different machine. It fills in the gap with pings from that file as well as it can, updates $nxtping taking the new pings into account, and then proceeds as usual.
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.
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 intolaunch.pl
(with concordant additions tosettings.pl
) that accomplish the following:After any successful
launch.pl
, TagTime copies its log up to a remote server, tagged with$remote_id
, a user-specified machine-specific string to distinguish it from any other instances, so that any instance can access any other instance's log.Then, when launching, if there's a gap between the last logged ping and now, before filling it in with RETRO, it tries to pull down the latest (by modification time) log from the specified remote server, which was presumably previously uploaded by a different machine. It fills in the gap with pings from that file as well as it can, updates
$nxtping
taking the new pings into account, and then proceeds as usual.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 killinglaunch.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.