Menu

#43 Tail doesn't work in script loop

general
open
nobody
None
5
2016-10-18
2016-10-14
mrfyx
No

Hi, "tail" option seems to not work properly in loop.

The following script doesn't work. When I run it, it does:

  • wget
  • tail
  • wget
  • nothing, it seems blocked
label main
+wget http://10.82.3.136:280/modsecurity.log
+then tail modsecurity.log
+sleep 15000
+loop
+end

My workaround is :

label main
+wget http://10.82.3.136:280/modsecurity.log
+then run "sfk tail modsecurity.log" -yes
+sleep 15000
+loop
+end

Thanks anyway for this tool.

SFK version 1.8.1 on windows

Discussion

  • stahlworks

    stahlworks - 2016-10-15

    when tail is reached multiple times by +loop,
    then as it is now, it blocks and waits for the file to be changed by a different process.
    (which never happens here as the current sfk process does the actual file creation).
    i will add an option -nowait for such cases in the next update.
    the workaround with run is correct, you may as well use

    +then filter -tail=10 modsecurity.log
    
     
  • mrfyx

    mrfyx - 2016-10-18

    Ok, thanks.

     

Log in to post a comment.

MongoDB Logo MongoDB