otherguy/docker-dropbox

Add constant logging of current dropbox sync status

Closed this issue · 4 comments

I see in this commit: fa87e3e that you removed the loop that was on line 91-95
This used to output a live log of the current sync status which was very useful.

Is it possible to add back a similar functionality, please?

Even if it is just optional/conditional with an env var like: STATUS_LOGS set to true.

That basically does something like:

while true; do
  gosu dropbox dropbox status
  sleep 1
done &

And add its output to the standard docker logs

I have also seen something similar to this on other forks of janeczku/dropbox
for example:
(https://github.com/jamesfreeman959/docker-dropbox-fix/blob/master/run)

And I tried to add this to my fork of your repo in docker entrypoint script in but I failed because i don't know where to place the loop exactly...

Please help?

Thanks @khalilgharbaoui, that's a good idea and I will try to add it back in!

@otherguy I actually found another solution that I place in a file show_log that I can run next to my docker-compose file when I need it by simply running ./show_log

#!/bin/bash

TIMEOUT=301
PID=$$

(sleep $TIMEOUT && kill -9 $PID) &

while true
do
  docker-compose exec dropbox gosu dropbox dropbox status | ts [$PID][%F-%H:%M:%.S]
  sleep 1
done

But of course, if it was built in I would not have to resort to this. 😅
Hope this helps.

I'm glad you found a way to make it work for you, @khalilgharbaoui.

But I totally agree, this should be a container feature again, and I have therefore added it back in and released version 1.6.0!

Could you please test if this is working for you?

I think it might be a bit heavy on the cpu to poll for the status every second. The load is low, but it's still higher than I would expect for such a feature.