async file system notification testing

Description

async can operate in "continuous mode" (option -C or --continuous) by listening to file system notifications (as of async 1.2).

File system notifications are a feature of the computer that makes the changes, so if async runs on the same computer that adds, removes, modifies or renames files, it is able to detect changes immediately and synchronize them to its remote peer.

Environment

  • Operating System: Linux

Testing

To test if notifications work correctly, and also to troubleshoot cases where you suspect async is not getting all or the right notifications, use the inotify_test tool attached at the end of this article.

To use, just run it with one argument--the directory to watch. For example:

./inotify_test /data/my_directory

 

Either run in a terminal or in the background (use nohup or equivalent when running in the background and needing to close the terminal that launched it).

It will log to syslog all the notifications that it receives - for example:

Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 1 mask=IN_CREATE IN_ISDIR (40000100) cookie=0 name=X2
Mar 11 18:31:30 sku inotify_test[13225]: LOG WATCH added [23] for [/tmp//X2]
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CREATE IN_ISDIR (40000100) cookie=0 name=E1
Mar 11 18:31:30 sku inotify_test[13225]: LOG WATCH added [24] for [/tmp//X2/E1]
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CREATE (00000100) cookie=0 name=e2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=e2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CREATE IN_ISDIR (40000100) cookie=0 name=F1
Mar 11 18:31:30 sku inotify_test[13225]: LOG WATCH added [25] for [/tmp//X2/E1/F1]
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_CREATE (00000100) cookie=0 name=x3
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=x3
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_CREATE (00000100) cookie=0 name=x1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=x1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_CREATE (00000100) cookie=0 name=x2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=x2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_ATTRIB IN_ISDIR (40000004) cookie=0 name=F1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 25 mask=IN_ATTRIB IN_ISDIR (40000004) cookie=0 name=
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CREATE (00000100) cookie=0 name=e1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=e1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CREATE (00000100) cookie=0 name=e3
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=e3
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_ATTRIB IN_ISDIR (40000004) cookie=0 name=E1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 24 mask=IN_ATTRIB IN_ISDIR (40000004) cookie=0 name=
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CREATE (00000100) cookie=0 name=f3
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=f3
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CREATE (00000100) cookie=0 name=f2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=f2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CREATE (00000100) cookie=0 name=f1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_CLOSE_WRITE (00000008) cookie=0 name=f1
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 1 mask=IN_ATTRIB IN_ISDIR (40000004) cookie=0 name=X2
Mar 11 18:31:30 sku inotify_test[13225]: LOG NOTIF 23 mask=IN_ATTRIB IN_ISDIR (40000004) cookie=0 name=

 

Attachments

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk