use lock to solve problem of 'database is locked'
ignore var dir