Which inotify event signals the completion of a large file operation?

for large files or slow connections, copying files may take some time.

using pyinotify, I watched the IN_CREATE event code. but this seems to happen at the beginning of the file transfer. I need to know when the file is fully copied - it is very useful if it is only halfway.

when the file transfer is completed and completed, what inotify event is fired?

+3
source share
3 answers

IN_CLOSE, , , . , , , ( ..), , , . ( , , , , , , , ).

IN_CLOSE IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, , . (, , - WRITE/NOWRITE , - ).

Documentation/filesystems/inotify.txt ( , ).

+12

script , . WinSCP, .filepart .

script, , .filepart , , .filepart, , , .

, , IN_MOVED_IN, script , .

, , incrontab:

/your/directory/ IN_ALL_EVENTS echo "$$ $@ $# $% $&"

tail -F /var/log/cron

, , .

!

+1

? IN_CLOSE IN_CREATE . , , .

, .

0

Source: https://habr.com/ru/post/1746820/


All Articles