possible to share time across multiple pcs?

Asked by Michael O'Donnell

Hi, I have several laptops (one for each child now that we have lockdown and they have to school from home). I love your tool but I'd like to be able to share the time used across all the PCs? So I can set them each up with an account and it doesn't matter which laptop they use they get the same time allocation. At the moment they can swap laptops to get more time (cheeky rascals!!)

I tried to put the var/lib/timekpr files on to a NAS and mount the folder. I also tried to create a sym link. This sort of worked but for some reason the files are read only so the work files never get updated and every 30 secs the save fails and notification appears that the time has been updated (I guess this is because the memory is getting reset with the failed disk write?

Any thoughts on a way to do this? Is it supported? I'm thinking of using rsync to sync the folders across each PC so each PC uses it's own local store but the amount of time used is still maintained for each kid across each laptop.

any other suggestions? is this a supported config?

Thanks for your help.

Question information

English Edit question
Timekpr-nExT Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Eduards Bezverhijs (mjasnik) said :

It should be possible to mount the directory as you did as Timekpr-nExT does not care where files are, they just have to be available on /var/lib/timekpr.

Time notification pops up probably because when it tries to save the file, it resets last change date in memory and that differs from actual write to file (which does not occur according to your story), since I support direct file editing too, it compares the dates, sees the difference, resets in memory config and loads the old values.

Timekpr daemon runs as root, so it must be able to save the files anywhere, if it can not, that machine is having more urgent problems than timekpr can not update time file :) At least that was the thinking.

I would take care of permission issues on filesystem / NAS level, after that it should work. I don't know what happens when child uses multiple computers at once, because Timekpr-nExT was designed as multi-user on the same machine type of thing.
I would make sure timekpr can actually write to the files, just check them manually and possibly watch the log files. Also make sure that time is correct and the same on NAS unit and laptops.

Also, please send me the log files from /var/log/timekpr* either by e-mail or put somewhere on internet, like google drive and send me a link to them. I'll look into what actually happens there.

Revision history for this message
Michael O'Donnell (modonnell487) said :

Hi, thanks for the quick response.

I've checked the file permissions and all seems to be ok. I switched to root and tried to manually edit the file which worked fine.
I've checked the time of both laptop and NAS and again they appear to be in sync.

I did notice that in the *.time files the "last_checked" value is updated but the Time_Spent_* values are not updated consistently. They do seem to update at times because the values are not 0.

There are some errors in the log file but I can't make anything of it. Hopefully you will be able to advise. Please don't worry to much about it as it's outside of the scope of the original functionality and I can use as is and may use rsync to keep the files synced sufficiently.

I'm also not expecting one child to login to multiple machines at the same time but we do share the devices so I would like to be able to have a central collection of how much screen time they've had.

Revision history for this message
Eduards Bezverhijs (mjasnik) said :

It is odd, to be honest. I am about to release a new version soon, but before that I really would like to look at the log files for your situation.

Maybe there is a nasty bug in there, which prevents this type of usage, which otherwise should work just fine. Log files do not have anything sensitive, just usrrnames, if you don't want me to see tjem replca them with userx, usery, etc.

Please send me the log files and please mention which type of FS NAS utilizes. This would be imortant as I check last modification date of file to detrrmine whether file is modified externally.

Revision history for this message
Michael O'Donnell (modonnell487) said :

Hi Eduards,

I sent you a link to the files via the 'contact this user option'. I don't get to see your email address so I just shared the link so anyone with the link can access (hence why I don't want to put it directly in here as anyone with the link can access).

Can you confirm if you received the email link? and if you now have a copy of the log?

The NAS is using ext4 filesystem which my linux pcs also use.


Revision history for this message
Eduards Bezverhijs (mjasnik) said :

I have not received a notification.
My e-mail should be visible either here https://launchpad.net/~mjasnik or please look at this link https://mjasnik.gitlab.io/timekpr-next/#bugs , e-mail address is there in an obfuscated form.

Revision history for this message
Eduards Bezverhijs (mjasnik) said :

Sorry, I was wrong, your notification which went through launchpad ended up in spam folder, I just checked and it was there.
E-mail provider automated system thinks that this important info is spam :D

Revision history for this message
Michael O'Donnell (modonnell487) said :

Glad you found it :-)
Hopefully you haven't missed many others!


Revision history for this message
Eduards Bezverhijs (mjasnik) said :

I did, some users did contact me via "Contact this user" and I just found them.

I have to remember to check spam folder more often :)

I'll look into this and get back to you with results.

Revision history for this message
Eduards Bezverhijs (mjasnik) said :

To sum up this, we discovered that the possible problem was file modification times when using cifs/samba mounts.
In the log files there was nothing suspicious, so I believe this was not an issue with timekpr.

When using NFS, no such problems were found and everything works as expected.

Revision history for this message
Milan Knizek (knizek) said :

I am looking for a similar use case. Luckily, I do not need "time spend" accounting, I only need to distribute any changes in /var/lib/timekpr/config files.

I eventually created a dedicated `timekpr` user on my Nextcloud instance and set up a systemd timer to run nextcloudcmd on that directory every 10 minutes on each computer.

This kind of works for my purpose - I can edit the USER.conf file to change the time limits from/to from anywhere (via Nextcloud or any other computer), unfortunatelly, nextcloudcmd does only a "one off" sync, i.e. it cannot poll for local or server changes.

Can you help with this problem?

Provide an answer of your own, or ask Michael O'Donnell for more information if necessary.

To post a message you must log in.