wimleers / fileconveyor

File Conveyor is a daemon written in Python to detect, process and sync files. In particular, it's designed to sync files to CDNs. Amazon S3 and Rackspace Cloud Files, as well as any Origin Pull or (S)FTP Push CDN, are supported. Originally written for my bachelor thesis at Hasselt University in Belgium.
https://wimleers.com/fileconveyor
The Unlicense
341 stars 95 forks source link

Option to exclude directories #154

Closed anishcorratech closed 10 years ago

anishcorratech commented 10 years ago

Hi,

I am looking for an option to exclude the some of the directories from fileconveyor.

I am trying to sync:

/var/www/html

This is syncing perfectly fine. But I would like exclude directories inside it like:

/var/www/html/media /var/www/html/skin /var/www/html/js

can you please provide me a sample config for the same.

Thanks Anish

wimleers commented 10 years ago

In your <filter>, add <ignoredDirs>media:skin:js</ignoredDirs>. That should be it :)

anishcorratech commented 10 years ago

I have added the ignore dirs now:

<config>
  <sources ignoredDirs="media:skin:js">
    <source name="html" scanPath="/var/www/html" />
  </sources>

This is working only partially. The file are only being ignore from the root of these directories:

/var/www/html/media /var/www/html/skin /var/www/html/js

but if file-conveyor detects a change in a sub-directory or sub-sub-directories it is pushing it to Server (transporter="cloudfiles")

for ex senario:

If file-conveyor detects a change inside /var/www/html/media/catalog/images or /var/www/html/skin/frontend/templates/css/ this is pushed to cloud

Is it possible to ignore in a recursive manner?

Thanks

wimleers commented 10 years ago

D'oh :(

If you look at https://github.com/wimleers/fileconveyor/blob/master/fileconveyor/fsmonitor.py, you'll see that is_in_ignored_dir looks at every directory in the file's path. So… it should be working recursively.

I think you may be seeing changes that were already queued. It's probably best if you start fresh, by deleting File Conveyor's DBs.