help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] fswatch > Filtering by Event Type


From: aws backup
Subject: [Help-bash] fswatch > Filtering by Event Type
Date: Thu, 22 Dec 2016 22:39:01 +0200

Hello,

I hope I am in the right mailing list and maybe somebody has experience with 
fswatch.

I am trying to make a little bash script for a video upload watch folder on OS 
X. I chose s3cmd to upload the videos to amazon s3.
Automator does not work reliable and only creates an event when a file is added 
but nut when it is modified.
Therefore I though to try it with fswatch. So far it's working but fswatch in 
the default setting sends all events. File removed, file modified, file renamed 
ect. For file reamed it generates two events. For the old name and the new 
name. 
For my uploading script I need only created and modified. Everything else 
creates failures in the upload script.

There is chapter in the fswatch documentation about Event Filters:

4.9 Filtering by Event Type

Events can be filtered by event type passing fswatch a list of event type names 
to accept using the --event option:

$ fswatch -x --event Created --event Removed ~

If no event type filters are specified fswatch will accept events of any type; 
on the other hand, as soon as a filter is specified, only events with a 
matching type will be accepted.

I tried to apply it in my script:

fswatch -0 -x --event Created --event Updated --event Renamed -Ie '.*\.*$' -i 
'.*\.mp4$' /path/to/folder | xargs -0 -n 1 /path/to/s3cmd.sh

But the filter does not work. Is there anything wrong with my syntax? 
Or a logical mistake?

Thank you for your help.

Regards,
Robert

reply via email to

[Prev in Thread] Current Thread [Next in Thread]