DX Unified Infrastructure Management

  • 1.  dirscan on linux

    Posted Jul 27, 2017 04:36 PM

    Hi All,

    I am trying to use dirscan on a Linux system, and when it detects a file over a certain size and by a certain extension when found delete the file. The first part is working fine, it is detecting the file of a certain size and generating an alarm, but it is not deleting the file. Under the size tab in the command line I am entering : rm *.hprof  but clearly that command syntax is incorrect coming from dirscan on linux, Can anyone tell me what the correct syntax would be to get this to work?  BTW in the setup button, Iam using the Run as user section with the correct username and password of the files owner.



  • 2.  Re: dirscan on linux

    Posted Jul 29, 2017 06:22 PM

    I wouldn't use that in the command line, I usually write bash scripts at the least to have dirscan call and perform the action. This is what I do for performing actions from other probes as well.



  • 3.  Re: dirscan on linux
    Best Answer

    Posted Jul 30, 2017 02:49 PM

    Hi!

    Can you try put "-f" parameter of your "rm" command and also put the full path of the directory? Like this:

    rm -f /path/to/directory/*.hprof



  • 4.  Re: dirscan on linux

    Posted Aug 01, 2017 01:17 PM

    Thanks, that did it.  Just adding the –f  switch in the command line made all the difference.

     

    Patrick



  • 5.  Re: dirscan on linux

    Broadcom Employee
    Posted Jul 30, 2017 09:17 PM

    Please try to declare "full path" for command and file.

    example

    /usr/bin/rm /aaa/bbb/ccc