My company uses OwnCloud to sync data from partner companies. In the files back-end, a script triggers every several minutes to scan the uploaded files and inject the contents into a database.
The problem is, the format of the data our partners upload are varied. We decided rather than performing an auto-detect, we’ll just put a “config.yaml” file somewhere within the user’s OwnCloud directory. That is, a “metadata” file that describes the partners’ data format.
This begat another problem: How do we ensure the file to be protected from inadvertent erasure and/or editing.
I had this idea:
- First time
config.yaml
is found under<userdir>/files
, it gets copied into<userdir>
.- If a new
config.yaml
file is detected (based on timestamp), the new file overwrites the old file.
- If a new
- When the file is missing and a copy exists in
<userdir>
, the copy gets written back to<userdir>/files
and anocc sync
performed (to push back the config.yaml file to the partner’s client).
Now my question: Is placing an additional file in <userdir>
safe? That is, will OwnCloud Server leave the file alone and not delete/overwrite it?