开发者

Does inotify trigger the IN_DELETE before or after deletion?

开发者 https://www.devze.com 2023-03-08 17:03 出处:网络
I\'m trying to backup a file before it gets deleted. Can someone tell me if inotify trigg开发者_如何转开发ers the event before or after deletion?The IN_DELETE is triggered when a file/directory is del

I'm trying to backup a file before it gets deleted. Can someone tell me if inotify trigg开发者_如何转开发ers the event before or after deletion?


The IN_DELETE is triggered when a file/directory is deleted in the watched directory, ie after the deletion.


but is'it possible to make inotify trigger before each action.

rm -rf /media/disqueExterne/ and inotify send an alert as do a database server before each access to a record..

here :

[bash command rm -rf /media/disqueExterne ] ---> [system pipe ] ---> direct order ---> [/dev/sdd1 ] ---> files destroyeds

with inotify pretrigger

[bash command rm -rf /media/disqueExterne ] ---> [ system pipe] --> [inotify pretrigger catch ] ---> backup each file ---> securised rm -rf order ---> [/dev/sdd1 ] ---> files destroyeds is it possible to catch the commands in a system pipe or buffer before sending the order.

[user send a command ] ---> [buffer] ---> order [ action launched] and after

[user send a command ] ---> // inotify hold data ---> [inotify action] --- // --> [return to buffer ] ---> order ---> [action launched ]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号