Teekanne / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

Dropbox filtering not working as expected #337

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Specify a filter in openhab.cfg, i.e. dropbox:uploadfilter=/configurations/.*
2. Restart openHAB runtime
3. Dropbox will no longer sync at all!

What is the expected output? What do you see instead?

Expect only the files in my configuration folder to be uploaded to Dropbox, but 
instead nothing is synced.

What version of the product are you using? On what operating system?

Snapshot 1.3.0 on Ubuntu 12.04

Please provide any additional information below.

See discussion 
(https://groups.google.com/forum/?fromgroups#!topic/openhab/raP7FNS8fnA) for 
more details if required.

Original issue reported on code.google.com by ben.jone...@gmail.com on 9 Jun 2013 at 8:13

GoogleCodeExporter commented 8 years ago
fixed with 
http://code.google.com/p/openhab/source/detail?r=53874e06e1cdfbfee7a038979f4f26b
74891e296

Ben, could you confirm the fix?

Original comment by teichsta on 18 Jun 2013 at 8:46

GoogleCodeExporter commented 8 years ago
Hi Thomas, 

I tried this change out overnight and it is only partly working. I set the 
upload/download filters to "/configurations/.*" so that I would only be syncing 
my config files. I have the intervals set to;

# upload every morning at 6am (download every minute)
dropbox:uploadInterval=0 0 6 * * ?
dropbox:downloadInterval=0 0/1 * * * ?

What I was finding is the download side of things seemed to be working, i.e. 
every minute changes from my local PC were being downloaded to my server 
running openHAB. Only changes in my configurations folder were being downloaded.

However in the morning when I check my local PC all directories were empty. I 
assume this was because the upload filter had excluded all files and uploaded 
empty directories to Dropbox. The configurations sub-folders were there but no 
files were inside.

I have reverted back to commenting out the filters and letting it run the 
defaults - i.e. download configurations only, and upload configurations/etc/log.

Original comment by ben.jone...@gmail.com on 19 Jun 2013 at 9:24

GoogleCodeExporter commented 8 years ago
ok, thanks for testing!

Will look into it ...

Original comment by teichsta on 21 Jun 2013 at 5:42

GoogleCodeExporter commented 8 years ago
How did you define the filter exactly? With our without (double) quotes?

Original comment by teichsta on 10 Jul 2013 at 2:55

GoogleCodeExporter commented 8 years ago
aha, the problem appears to be the '/' at the end of the filter. Changed the 
defaults accordingly. Furthermore i introduced a "fake mode" which let's you 
unobtrusively test your filter settings (see 
http://code.google.com/p/openhab/source/detail?r=afb5efa7943c3c48ffa0a7d4923d8ff
a70af45dc).

Regards,

Thomas E.-E.

Original comment by teichsta on 12 Jul 2013 at 1:01

GoogleCodeExporter commented 8 years ago
Great stuff Thomas - I will wait till 1.3.0 is released proper before testing.

Original comment by ben.jone...@gmail.com on 14 Jul 2013 at 2:24

GoogleCodeExporter commented 8 years ago
Hi,
since it seems to be the same issue "deleting files on dropbox"  - i will write 
here as a comment.

I downloaded the Build #443 yesterday. Downloading from dropbox worked after 
some tries, Upload did not work. At 2AM everything got deleted by openhab - the 
default setting seems to be different than the one specified in the 
configuration file. 

02:00:00.457 DEBUG o.o.i.d.i.DropboxSynchronizer[:320]- Started synchronization 
from Dropbox to local ...
02:00:00.559 DEBUG o.o.i.d.i.DropboxSynchronizer[:381]- Started synchronization 
from local to Dropbox ...
02:00:01.631 DEBUG o.o.i.d.i.DropboxSynchronizer[:337]- There are no deltas to 
download from Dropbox ...
02:00:01.632 DEBUG o.o.i.d.i.DropboxSynchronizer[:658]- Created file 
'/opt/openhab/./deltacursor.dbx' with content 
'AAG_pWrmJ1OBiNftPWd54ErBYyR1rUp4Q7LAL3ukUFtJbilXNg6zpmsViGd0tdLXbkMHXekt3_Vxw0M
4dab7gGN7OIHxVPlZIHo0KcYZR0IBnA'
02:00:04.558 DEBUG o.o.i.d.i.DropboxSynchronizer[:407]- There are '0' local 
entries that met the upload filters ...
02:00:04.968 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/humidity.items' from Dropbox
02:00:05.382 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/transform/wunderground_sunrise.xsl' from Dropbox
02:00:05.739 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/rollershutter.items' from Dropbox
02:00:06.075 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/window.items' from Dropbox
02:00:06.424 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/lux.items' from Dropbox
02:00:06.807 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/rules/rollaeden.rules' from Dropbox
02:00:07.180 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/rooms.items' from Dropbox
02:00:07.547 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/persistence/db4o.persist' from Dropbox
02:00:07.904 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/transform/yahoo_weather_sundown.xsl' from Dropbox
02:00:08.426 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/transform/yahoo_weather_temperature.xsl' from Dropbox
02:00:08.836 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/temperature.items' from Dropbox
02:00:09.188 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/sitemaps/default.sitemap' from Dropbox
02:00:09.583 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/transform/wunderground_sunset.xsl' from Dropbox
02:00:09.939 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/powerconsumption.items' from Dropbox
02:00:10.283 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/items/default.items' from Dropbox
02:00:10.632 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/persistence/rrd4j.persist' from Dropbox
02:00:11.000 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/rules/anwesenheit.rules' from Dropbox
02:00:11.373 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/rules/lux.rules' from Dropbox
02:00:11.736 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/rules/nacht.rules' from Dropbox
02:00:12.144 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/rules/default.rules' from Dropbox
02:00:12.500 DEBUG o.o.i.d.i.DropboxSynchronizer[:440]- Successfully deleted 
file '/configurations/transform/yahoo_weather_sunrise.xsl' from Dropbox
02:00:12.501 DEBUG o.o.i.d.i.DropboxSynchronizer[:454]- Deleted cache file 
'./dropbox-entries.dbx' since there are changes. It will be recreated while 
next synchronization loop.
02:00:12.732 DEBUG o.o.i.d.i.DropboxSynchronizer[:658]- Created file 
'/opt/openhab/./deltacursor.dbx' with content 
'AAGhPDSH6Pi8ACCGpA3iXzWGuIb0b0GlK2tcR7xX-DXl7DIYF0Pjf9NdJSS0TEUqDL0fpLHEhYbWaSV
8kq6K4k1BWgMzspVZch9yyXakmmfF8w'

21:24:46.072 DEBUG o.o.i.d.i.DropboxSynchronizer[:724]- Scheduled 
synchronization job (direction=Download) with cron expression '0 0/5 * * * ?'
21:24:46.078 DEBUG o.o.i.d.i.DropboxSynchronizer[:724]- Scheduled 
synchronization job (direction=Upload) with cron expression '0 0 2 * * ?'

#--------------------
# Config
#--------------------
# Operates the Synchronizer in fake mode which avoids up- or downloading files 
to and from Dropbox.
# This is meant as testMode for the filter settings (optional, defaults to 
false)
#dropbox:fakemode=true

# the up- and download interval as Cron-Expression. See the Quartz-Tutorial
# 
http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-0
6
# for more information on how to use them best (optional, defaults to '0 0/5 * 
* * ?'
# which means every 5 minutes)
#dropbox:uploadInterval=0 0/5 * * * ?
#dropbox:downloadInterval=0 0/5 * * * ?

# the AppKey, AppSecret combination (optional, defaults to official Dropbox-App
# Key-Secret-Combination)
#dropbox:appkey=
#dropbox:appsecret=

# defines the mode how files are synchronized with dropbox. Valid SyncModes are
# 'DROPBOX_TO_LOCAL', 'LOCAL_TO_DROPBOX' and 'BIDIRECTIONAL' (optional, defaults
# to 'LOCAL_TO_DROPBOX')
dropbox:syncmode=BIDIRECTIONAL

# the base directory to synchronize with openHAB, configure 'filter' to select
# files (optional, defaults to '.')
#dropbox:contentdir=

# defines a comma separated list of regular expressions which matches the
# filenames to upload to Dropbox (optional, defaults to '/configurations/.*,
# /logs/.*, /etc/.*')
dropbox:uploadfilter=/configurations/.*,/logs/.*, /etc/.*

# defines a comma separated list of regular expressions which matches the
# filenames to download from Dropbox (optional, defaults to 
'/configurations/.*')
dropbox:downloadfilter=/configurations/.*,/logs/.*, /etc/.*

Original comment by tim.wey...@gmail.com on 22 Jul 2013 at 7:39

GoogleCodeExporter commented 8 years ago
I can confirm this is now working on my latest 1.3.0 install. Thanks Thomas!

Original comment by ben.jone...@gmail.com on 1 Aug 2013 at 4:13