CCMS File Monitoring - Autoreaction for every new File

Hi Experts,
I have a folder with xml files. I monitor these files with the sapccmsr agent. this works fine. Now I want to establish an alerting for the files. If in one of these files contains the pattern "error", I want to generate an alert. I have generated a logfile template like here:
LOGFILE_TEMPLATE
DIRECTORY="E:/usr/sap/prfclog/sapccmsr/Test/"
FILENAME="*.xml"
MONITOR_FILESIZE_KB=1
PATTERN_0="Error"
VALUE_0=RED
if in a file the pattern "Error" exists the colour in rz20 is changed to red. this is working ...
now I come to my problem:
the names of the monitored files are changing. for example there is a file with the name "file_0.xml". the next day a new file with the name "file_x.xml" exists. so, for the alerting with autoreaction it is necessary that the system gives the autoreaction to each file in the monitor automaticly. is it possible? how can i solve this problem?
best regards
christopher

Hello Christopher,
> the names of the monitored files are changing. for example there is a file with the name "file_0.xml". the next day a new file with the name "file_x.xml" exists.
you monitor all theses files. The wildcard in the parameter "FILENAME" ensures this:
> FILENAME="*.xml"
> so, for the alerting with autoreaction it is necessary that the system gives the autoreaction to each file in the monitor automaticly. is it possible? how can i solve this problem?
A short look into the [online documentation|http://help.sap.com/saphelp_nw70/helpdata/EN/cb/0f8897c23b414ab6e562aa913971bc/frameset.htm] returns the parameters AUTOREACTION_LOC and AUTOREACTION_CEN.
Maybe they will be helpful?
Regards, Michael

Similar Messages

  • The first binary file write operation for a new file takes progressively longer.

    I have an application in which I am acquiring analog data from multiple
    PXI-6031E DAQ boards and then writing that data to FireWire hard disks
    over an extended time period (14 days).  I am using a PXI-8145RT
    controller, a PXI-8252 FireWire interface board and compatible FireWire
    hard drive enclosures.  When I start acquiring data to an empty
    hard disk, creating files on the fly as well as the actual file I/O
    operations are both very quick.  As the number of files on the
    hard drive increases, it begins to take considerably longer to complete
    the first write to a new binary file.  After the first write,
    subsequent writes of the same data size to that same file are very
    fast.  It is only the first write operation to a new file that
    takes progressively longer.  To clarify, it currently takes 1 to 2
    milliseconds to complete the first binary write of a new file when the
    hard drive is almost empty.  After writing 32, 150 MByte files,
    the first binary write to file 33 takes about 5 seconds!  This
    behavior is repeatable and continues to get worse as the number of
    files increases.  I am using the FAT32 file system, required for
    the Real-Time controller, and 80GB laptop hard drives.   The
    system works flawlessly until asked to create a new file and write the
    first set of binary data to that file.  I am forced to buffer lots
    of data from the DAQ boards while the system hangs at this point. 
    The requirements for this data acquisition system do not allow for a
    single data file so I can not simply write to one large file.  
    Any help or suggestions as to why I am seeing this behavior would be
    greatly appreciated.

    I am experiencing the same problem. Our program periodically monitors data and eventually save it for post-processing. While it's searching for suitable data, it creates one file for every channel (32 in total) and starts streaming data to these files. If it finds data is not suitable, it deletes the files and creates new ones.
    On our lab, we tested the program on windows and then on RT and we did not find any problems.
    Unfortunately when it was time to install the PXI on field (an electromechanic shovel on a copper mine) and test it, we've come to find that saving was taking to long and the program screwed up. Specifically when creating files (I.E. "New File" function). It could take 5 or more seconds to create a single file.
    As you can see, field startup failed and we will have to modify our programs to workaround this problem and return next week to try again, with the additional time and cost involved. Not to talk about the bad image we are giving to our costumer.
    I really like labview, but I am particularly upset beacuse of this problem. LV RT is supposed to run as if it was LV win32, with the obvious and expected differences, but a developer can not expect things like this to happen. I remember a few months ago I had another problem: on RT Time/Date function gives a wrong value as your program runs, when using timed loops. Can you expect something like that when evaluating your development platform? Fortunately, we found the problem before giving the system to our costumer and there was a relatively easy workaround. Unfortunately, now we had to hit the wall to find the problem.
    On this particular problem I also found that it gets worse when there are more files on the directory. Create a new dir every N hours? I really think that's not a solution. I would not expect this answer from NI.
    I would really appreciate someone from NI to give us a technical explanation about why this problem happens and not just "trial and error" "solutions".
    By the way, we are using a PXI RT controller with the solid-state drive option.
    Thank you.
    Daniel R.
    Message Edited by Daniel_Chile on 06-29-2006 03:05 PM

  • "A new folder for every project file"

    Aha!!  Right, from now on ... (thanks Steve)
    From the Muvipix.com Guide to Adobe PE11 by Steve Grisetti
    (p 36) [on starting and saving a new project]
    2     Click the Browse button to choose a location to save your new
    project file.
    We at Muvipix recommend always selecting the Browse option and,
    wherever you choose to save your file, creating a new folder for every
    new project file.
    This little bit of housekeeping keeps all of your new project's files in
    one neat, little folder. And, when your project is done and you want to
    clear it from your computer, you can then remove not only the project
    file but all of the temp, render and scratch disk files Premiere Elements
    has created for that project simply by deleting that single folder!
    This makes post-project clean-up a much easier and neater process.
    OK, hope I've got it this time (at last)
    cheers
    Brian

    Oh no!  I thought I’ll re-work that Canal video again, but this time saved the project from the very start in a new folder on an ext HD (500 GB) connected USB3.0.  Tried all sorts of things on it, saved each time in the same folder.   Cleared all 14 clips from Project Assets (which of course emptied the timeline).   Shut down PE11.   Checked via Windows Explorer that the project files were all on the ext HD – and by the way, there are no other files on it, just the PE files.  My understanding is that Advanced System Care Pro (Iobit) regularly defrags all my drives if necessary (tho’ I haven’t done this manually for months with this drive).
    OK, opened PE, went to Open Recent Projects, it shows the above .prel file and the entire path, I click on it and – 
    Weird, just weird
    Nil desperandum
    Brian
    Edited --- and another weird thing, my email isn't sending the complete message I type to this forum.   I sent a whole message once and it never appeared, but this time it's cut off half a sentence above (it did this before, earlier today).
    That sentence should read,
    OK, opened PE, went to Open Recent Projects, it shows the above .prel file and the entire path, I click on it and – nothing happened!   (You'll have gathered that's what happened, but I wrote it in my Windows Live Mail, sent via BT-Yahoo ISP ......... )  Hey wait, there was a whole lot more.
    Here's a copy / paste from Windows Live Mail outbox
    It’s so odd, because as I said previously, most of the time it works so well, does all the things it’s supposed to do.   I followed Steve’s instructions here to the letter.   By the way, as you know, it’s not just the ext HD, this has been happening all along with allowing PE to save everything in its default Folder 11.
    I would be – now – very sorry indeed to have to abandon PE11 simply on this account, but it’s causing me to waste such a lot of time.   (Let alone the expense of buying it, plust one Lynda.com course, plus 2 books – not forgetting that I’d previously tried the Corel software and bought a book and DVD for that too!!)
    Might just use – what’s that simplicity-itself thingy everyone uses who just want to get any old kind of thing up on You Tube ..........   Oi vey!! <<more weary sigh>>
    Weird, just weird
    Nil desperandum

  • File adapter. Only get new files

    Hi there,
    I have a small problem that I'm not able to solve that easily with XI.
    I have some directories that I need to get files from on a remote server. The only problem is i need to get only the new files and I am not allowed to delete the old files. Since we are not the only one getting those files.
    So far I have not found any option to keep the old files and only get the new ones. Does anybody know a neat trick to get only the new ones?
    Regards,
    Wietse

    > Hi again Wietse,
    > After configuring the file adapter the way i
    > mentioned,check for performance, you might need to
    > install remote Adapter engine if you have some FW
    > problems or other security barriers that turn the
    > processing of this file to a hassel over the net.
    >
    > Nimrod
    Problem still is I am not allowed to do anything else then ftp/get on the files. I can't install a remote adapter engine or change anything to the files.
    I hoped that it would be possible to store the filenames somewhere and compare a dir listing to the stored filenames before the real get is done. But even when writing an adapter module, the file will already be in the adapter once the module kicks in. And I don't want to get old files that I've already processed into my system since there is a huge history of files on the machine.
    I think I might end up writing a perl script that searches for the new files and gets them and them sends them through to XI using a SOAP call.

  • Changing customer number in alv top of page for every new customer

    hi experts,
    in alv grid display top-of- page, how to change customer number  customer name for every new customer.
    please help me.
    Regards
    Naveen.

    You may look into this blog
    http://help-abap.blogspot.com/2008/09/salv-model-5-add-header-top-of-page.html
    This is has been contributed by one of the SCN contributor Naimesh Patel.

  • How do i increase my key ID +1 for every new user

    what iam trying to do is that for every new user that register on my app will get a key id.. that is +1 higher then the old highest id.. i have done this i JavaDB but in mysql i get an exception
    here is my sql Q:
    sql = "insert into " + mytest_TABLE + "(" + mytest_ID + ", " + mytest_NAME
    + ") values ((case when (select max(" + mytest_ID + ") from " + mytest_TABLE + ")"
    + "IS NULL then 1 else (select max(" + mytest_ID + ") from " + mytest_TABLE + ")+1 end), "
    + encodeSQL(firstName) + ")";
    here is my exception:
    by the way mytest is my table..
    java.sql.SQLException: You can't specify target table 'mytest' for update in FROM clause
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3250)
    at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1355)
    at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1270)
    at cont.tt.updateContact(tt.java:49)
    at cont.tt.jButton3ActionPerformed(tt.java:179)
    at cont.tt.access$200(tt.java:6)
    at cont.tt$3.actionPerformed(tt.java:140)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6038)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4410)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2429)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    sry for my bad english..
    really hope someone can help me out

    You need an 'Identity' column. In MySQL, you need to enable autoincrement and don't insert a value in the column while adding records; MySQL will auto increment the value.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Mail to be send for every new pur group

    Hi ,
    I have to send mail to recipients of  the purchase grp ekgrp..
    right now im able to send mail to all purchase orders of the pur.group, individually.
    but my requirement demands that
    the mail has to triggered for every new pur.group, all the pur orders wthin that group has to come in the mail body of that purchase group.
    now actually one loop is already running, plz avoid nested loops.. and  help me out asap.
    I give you the following code .
    all respective data declared above.
    FORM form_send_mail .
      SELECT ekgrp smtp_addr FROM zmmtr_ekko INTO TABLE it_zmmtr_ekko.
    SORT it_final by ekgrp.
      LOOP AT it_final." into wa_final.
        CLEAR: wa_objtxt,wa_reclist,wa_doc_chng,wa_objpack,g_tab_lines.
        REFRESH:it_objtxt,it_reclist,it_objpack.
    Mail Subject
        wa_doc_chng-obj_descr = c_subject.
    *Mail sensitivity
        wa_doc_chng-sensitivty = c_p.
    *Fetching employee name
        READ TABLE it_zmmtr_ekko  WITH KEY ekgrp = it_final-ekgrp.
        IF sy-subrc = 0.
          g_email = it_zmmtr_ekko-smtp_addr.
        ELSE.
          CONCATENATE c_message it_final-ekgrp INTO g_message SEPARATED BY space.
          WRITE: g_message.
          CONTINUE.
        ENDIF.
        MOVE c_hi TO wa_objtxt.
        APPEND wa_objtxt TO it_objtxt.
        CLEAR wa_objtxt.
            APPEND wa_objtxt TO it_objtxt.
          CONCATENATE c_po it_final-ebeln INTO wa_objtxt SEPARATED BY space.
          APPEND wa_objtxt TO it_objtxt.
          CLEAR wa_objtxt.
         APPEND wa_objtxt TO it_objtxt.
        DESCRIBE TABLE it_objtxt[] LINES g_tab_lines.
        READ TABLE it_objtxt into wa_objtxt index g_tab_lines."INTO wa_objtxt INDEX 1."g_tab_lines.
        wa_doc_chng-obj_langu = c_en.
    *Size of message body
        wa_doc_chng-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( wa_objtxt ).
    *Creation of the entry for the compressed document
        CLEAR wa_objpack-transf_bin.
        wa_objpack-head_start = 1.
        wa_objpack-head_num = 0.
        wa_objpack-body_start = 1.
        wa_objpack-body_num = g_tab_lines.
        wa_objpack-doc_type = c_raw.
        APPEND wa_objpack TO it_objpack.
    *Completing the recipient list
    *target recipent
        REFRESH: it_reclist.
        CLEAR: wa_reclist.
        wa_reclist-receiver = g_email.
        wa_reclist-rec_type = c_u.
        APPEND wa_reclist TO it_reclist.
    AT NEW ekgrp.
          CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            EXPORTING
              document_data              = wa_doc_chng
              put_in_outbox              = c_x
              commit_work                = c_x
            IMPORTING
              sent_to_all                = g_sent_to_all
            TABLES
              packing_list               = it_objpack
              contents_txt               = it_objtxt
              receivers                  = it_reclist
            EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 8.
        ENDAT.
        CASE sy-subrc.
          WHEN 0.
              WRITE: / c_mail ,g_email,c_mail0,it_final-ekgrp, it_final-ebeln, it_final-lifnr.
              SKIP 1.
          WHEN 1.
            WRITE: / c_mail1."chk mail content and do it..
            SKIP 1.
          WHEN 2.
            WRITE: / c_mail2.
            SKIP 1.
          WHEN 3.
            WRITE: / c_mail3.
            SKIP 1.
          WHEN OTHERS.
            WRITE: / c_mail4.
            SKIP 1.
        ENDCASE.
      ENDLOOP.
      WRITE:       / c_mail5.
      SKIP 1.
    ENDFORM.                    " FORM
    Rgds,

    The newly created database should automatically get picked up the maintenance plan.
    http://sqlmag.com/sql-server/inside-database-maintenance-plans
    No need to manually update the plan. I feel you need to have valid full backup for its successive Diff or Transaction log backup. 
    Are you getting any error in the job history?
    -Prashanth

  • Include report header for every new page.

    Hi expert,
    I have create a report with two buttons, 'previous page' and 'next page'. when i click the buttons, my report will go to another new page. I am using NEW-PAGE in my report.
    My problem now is, how can i include TOP-OF-PAGE for every new page in my report? When i click on the button, the TOP-OF-PAGE will not trigger by my report.
    Pls advise how to solve it.
    Thanks in advance.

    top-of-page will get triggered in spool request only when u run in background.

  • According to material num,for every new material num  one line space.

    Hi,
    please give suggestion how to get vertical lines without breaking as shown below.
    I want according to material number(AT1),for every new material number  one line space have to be there.
    I used 'skip' so the verical line is breaking for every new material.
    Material Number  |   Material Description
    _____________ |______________________________________________
    |    AT1                  |   Catalyst - 18165-RNA-A013-Y2
    |    AT2                  |   Catalyst - 18165-RNA-A013-Y2
    |    AT3                  |   Catalyst - 18165-RNA-A013-Y2 (COPY)
    |    AT4                  |   Catalyst - 18165-RNA-A013-Y2
    |    AT5                  |   Catalyst - 18165-RNA-A013-Y2
    |   CGW0001             SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    |  CGW0001              SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    |  CGW0001              SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    CGW0001             SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    |   CGW0001             SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    |   CGW0001             SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    |   CGW0001             SUBSTRATE 148 X 84 X 67 - 400/6/S/0.699L
    I need line continous but for every new material to material gap.
    Thanks,
    sree.

    Hi,
    write code like this.
    write : /1 sy-vline,120 sy-vline.
    give the line size for ex 120
    reward if usefull

  • Any way to PERMANENTLY zoom Firefox a certain amount, rather than having to re-zoom-in again every time for every new webpage?

    Any way to PERMANENTLY zoom Firefox a certain amount, rather than having to re-zoom-in again every time for every new webpage?
    == This happened ==
    Every time Firefox opened

    https://addons.mozilla.org/en-US/firefox/addon/6965
    http://urandom.ca/nosquint/

  • Trigger SEQ column for every new value of ID it should start from 1

    I have
    table table_A
    (ID NUMBER,
    SEQ NUMBER,
    DETAIL VARCHAR2(2000))
    In this table ID and SEQ are combined primary key
    Data looks like
    ID     SEQ     DETAIL
    1000     1     COMMENTS1
    1000     2     COMMENTS2
    1001     1     COMMENTS3
    1002     1     COMMENTS4
    1002     2     COMMENTS5
    1002     3     COMMENTS6
    1003     1     COMMENTS7
    I have ID as oracle generated seq Number , but I need trigger to generate SEQ column value for every new value of ID it should start from 1

    This is probably not something you would want to do in a trigger. You would generally be much better off storing ID and detail in the table and generating SEQ in a view, i.e.
    CREATE VIEW my_view
    AS
    SELECT id,
           DENSE_RANK() OVER( PARTITION BY id ORDER BY <<something>>) seq,
           detail
      FROM table_AUnless you can guarantee that only one session will be inserting data at a time, I don't see how you could make a trigger work here.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • I upgraded my iphone to 5.0.1 and ever since, it has decided to delete old text messages. Only with one contact though, not everybody. So for every new text message I send this person, an old one gets removed. Why? I don't want this to happen.

    I upgraded my iphone to 5.0.1 and ever since, it has decided to delete old text messages. Only with one contact though, not everybody. So for every new text message I send this person, an old one gets removed. Why? I don't want this to happen.

    Connect the phone directly to the computer, not a hub.
    Disconnect all other USB devices except keyboard and mouse.
    Disable your firewall
    Disable your antivirus
    In iTunes if it recognizes the phone click "Restore"
    If it doesn't recognize the phone:
    Disconnect the phone from the phone end, leave the USB cable plugged into the computer
    Hold the HOME and SLEEP buttons until the screen turns black, excactly 10 seconds, then release the SLEEP but continue holding the HOME (If an Apple logo appears you have held SLEEP too long; do it over)
    While holding HOME connect the cable to the phone
    As soon as iTunes recognizes the phone release the HOME button and it should restore.
    If neither procedure works note the exact error message and post it.

  • On-demand scanning for only new files or scan a list from a file

    I run a free to use file hosting service and with it are the risks of abuse for malware. In the past I've used ClamAV with a bash script to search for any files that are as old or newer than X minutes, usually about 5 minutes and put the found files listed line by line in a file and ClamAV will scan those files only. Put on a Cron for every 5 minutes to run. ClamAV's detection is pathetic though and has not caught most of the stuff it has needed to find. So switching over to Sophos Linux, it has done a great job already detecting multiple files of the uploaded files folder that ClamAV had already missed in the past. It takes just 3 1/2 minutes for it to scan through 3500+ files and archives totaling 17 gigs. I have it set to scan the whole directory every 5 minutes. This takes a while, even if it is under 3 1/2 mins. Ideally I want Sophos to only scan new files so it can be set to run every minute, or every 5 minutes, whether that be from it's command line or via it reading a file list. This way newly uploaded malware is taken care of as fast as possible for the security of the end users.  Here is the script file I use for Sophos already: #! /bin/bash
    PATH=/home/user:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    if [[ $UID -ne 0 ]]; then sudo "$0"; exit 0; fi
    # Directories to scan
    scan_dir="/home/user/directory/files/"
    # Virus relocation folder
    virus_vault="/home/user/directory/viruses/files/"
    # Create new log folder if it doesn't exist
    mkdir -p /home/user/directory/viruses/logs/$(date +%Y-%m)
    # Location of log file
    tmp_log_file="/home/user/directory/viruses/logs/$(date +%Y-%m)/sophos-scan-$(date +%Y-%m-%d)-tmp.log"
    log_file="/home/user/directory/viruses/logs/$(date +%Y-%m)/sophos-scan-$(date +%Y-%m-%d).log"
    # Scan files and remove (--remove) infected
    savscan $scan_dir -nc -ss -archive -all -suspicious -pua --quarantine -move=$virus_vault -p=$tmp_log_file
    # Format log
    echo " " >> "$log_file"
    echo " " >> "$log_file"
    echo "-----------------" >> "$log_file"
    echo " " >> "$log_file"
    date >> "$log_file"
    echo " " >> "$log_file"
    echo "-----------------" >> "$log_file"
    echo " " >> "$log_file"
    # move consolidate log to daily file
    cat $tmp_log_file >> $log_file
    # remove temporary file
    rm -f $tmp_log_file
    # make sure virus files are right owners
    chown -R user:user $virus_vault Here is what it's based off, what I did for ClamAV to find new files and scan those only. #! /bin/bash
    if [[ $UID -ne 0 ]]; then sudo "$0"; exit 0; fi
    # Directories to scan
    scan_dir="/home/user/example.com/files"
    # Virus relocation folder
    virus_vault="/home/user/example.com/viruses/files"
    # Temporary file
    list_file=$(mktemp -t clamscan.XXXXXX) || exit 1
    # Create new log folder if it doesn't exist
    mkdir -p /home/user/example.com/viruses/logs/$(date +%Y-%m)
    # Location of log file
    log_file="/home/user/example.com/viruses/logs/$(date +%Y-%m)/clamscan-$(date +%Y-%m-%d).log"
    # Make list of new files
    if [ -f "$log_file" ]
    then
    # use newer files then logfile
    find "$scan_dir" -type f -cnewer "$log_file" -fprint "$list_file"
    else
    # scan last 5 minutes
    find "$scan_dir" -type f -cmin -5 -fprint "$list_file"
    fi
    if [ -s "$list_file" ]
    then
    # Scan files and remove (--remove) infected
    clamscan -f "$list_file" --move=/"$virus_vault" >> "$log_file"
    rm -f "$list_file"
    else
    # remove the empty file, contains no info
    rm -f "$list_file"
    fi
    exit 

    Quick comment...
    Sophos has 'decision caching' to speed up files that haven't changed since the last scan, while also allowing files to be re-checked against the latest threat definitions.

  • On-demand scanning for only news files or scan a list from a file

    I run a free to use file hosting service and with it are the risks of abuse for malware. In the past I've used ClamAV with a bash script to search for any files that are as old or newer than X minutes, usually about 5 minutes and put the found files listed line by line in a file and ClamAV will scan those files only. Put on a Cron for every 5 minutes to run. ClamAV's detection is pathetic though and has not caught most of the stuff it has needed to find. So switching over to Sophos Linux, it has done a great job already detecting multiple files of the uploaded files folder that ClamAV had already missed in the past. It takes just 3 1/2 minutes for it to scan through 3500+ files and archives totaling 17 gigs. I have it set to scan the whole directory every 5 minutes. This takes a while, even if it is under 3 1/2 mins. Ideally I want Sophos to only scan new files so it can be set to run every minute, or every 5 minutes, whether that be from it's command line or via it reading a file list. This way newly uploaded malware is taken care of as fast as possible for the security of the end users.  Here is the script file I use for Sophos already: #! /bin/bash
    PATH=/home/user:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    if [[ $UID -ne 0 ]]; then sudo "$0"; exit 0; fi
    # Directories to scan
    scan_dir="/home/user/directory/files/"
    # Virus relocation folder
    virus_vault="/home/user/directory/viruses/files/"
    # Create new log folder if it doesn't exist
    mkdir -p /home/user/directory/viruses/logs/$(date +%Y-%m)
    # Location of log file
    tmp_log_file="/home/user/directory/viruses/logs/$(date +%Y-%m)/sophos-scan-$(date +%Y-%m-%d)-tmp.log"
    log_file="/home/user/directory/viruses/logs/$(date +%Y-%m)/sophos-scan-$(date +%Y-%m-%d).log"
    # Scan files and remove (--remove) infected
    savscan $scan_dir -nc -ss -archive -all -suspicious -pua --quarantine -move=$virus_vault -p=$tmp_log_file
    # Format log
    echo " " >> "$log_file"
    echo " " >> "$log_file"
    echo "-----------------" >> "$log_file"
    echo " " >> "$log_file"
    date >> "$log_file"
    echo " " >> "$log_file"
    echo "-----------------" >> "$log_file"
    echo " " >> "$log_file"
    # move consolidate log to daily file
    cat $tmp_log_file >> $log_file
    # remove temporary file
    rm -f $tmp_log_file
    # make sure virus files are right owners
    chown -R user:user $virus_vault Here is what it's based off, what I did for ClamAV to find new files and scan those only. #! /bin/bash
    if [[ $UID -ne 0 ]]; then sudo "$0"; exit 0; fi
    # Directories to scan
    scan_dir="/home/user/example.com/files"
    # Virus relocation folder
    virus_vault="/home/user/example.com/viruses/files"
    # Temporary file
    list_file=$(mktemp -t clamscan.XXXXXX) || exit 1
    # Create new log folder if it doesn't exist
    mkdir -p /home/user/example.com/viruses/logs/$(date +%Y-%m)
    # Location of log file
    log_file="/home/user/example.com/viruses/logs/$(date +%Y-%m)/clamscan-$(date +%Y-%m-%d).log"
    # Make list of new files
    if [ -f "$log_file" ]
    then
    # use newer files then logfile
    find "$scan_dir" -type f -cnewer "$log_file" -fprint "$list_file"
    else
    # scan last 5 minutes
    find "$scan_dir" -type f -cmin -5 -fprint "$list_file"
    fi
    if [ -s "$list_file" ]
    then
    # Scan files and remove (--remove) infected
    clamscan -f "$list_file" --move=/"$virus_vault" >> "$log_file"
    rm -f "$list_file"
    else
    # remove the empty file, contains no info
    rm -f "$list_file"
    fi
    exit 

    Quick comment...
    Sophos has 'decision caching' to speed up files that haven't changed since the last scan, while also allowing files to be re-checked against the latest threat definitions.

  • Extra empty groupName in TDMS file when using DAQmx Start New File & stop DAQmx while waiting for trigger?

    I wrote a VI that listens to an external trigger coming from a PFI line and saves a user-defined number of pretrigger+posttrigger samples into disk, and then the DAQmx restarts to wait for the next trigger. I used the DAQmx Start New File.vi to change the filename of each of the next file. However, I found that for each of the resulting TDMS files, there is an additional group that is added in addition to the real data. For example, if the groupName is set to "task_voltage", then there is an additional groupName called "task_voltage #1".
    I suspect that this is because the program preallocate diskspace using the old filename for the pretriggered samples, but when the trigger happens and the samples are ready to be written into disk, an actual new file is opened and saved. The reason I think this might be the case is because, say each file would be 50kB and I already have 1 file triggered and saved, before the second trigger comes in, I can see that the file size of the first file is twice as much as it should be (100kB), but the file size will return to noraml (50kB) after the second trigger happens and a second file is created.
    Does anyone know if this is really the case? Is there a way to configure the task so that this doesn't happen?
    Another question I have is that the program currently set up so that the VI will wait until a trigger happens to return the values. However, this means that if a trigger doesn't happen, the VI waits indefintely, and the "stop" button in the while loop is useless. I have to use the "Abort Execustion" button on the tool bar to stop the VI. Is there a way to interrupt and stop the DAQmx task even if the trigger doesn't happen?
    Thanks in advance for any help!
    Attachments:
    pretrigger_loop_new_file.vi ‏29 KB

    I don't believe there is a way to programmatically change/delete the group name in a TDMS file. What you can do however, is convert between TDMS and TDM using the VIs found in the Data Storage palette and then perform whatever modifications you need using the TDM utilities.
    Applications/Systems/Test
    National Instruments | AWR Group

Maybe you are looking for

  • HT4623 Opening multiple tabs within Internet Safari on my iPad mini

    How am I able to open multiple tabs within Internet Safari on my iPad mini?? I have an iPhone and I can do so but on my iPad mini I can't figure it out or it just doesn't have that option. Someone please help with some answers, thank you!!

  • Work computer won't display songs

    Okay, so I have been running my I-pod on my work computer. It was working just fine for months. All of a sudden i plugged in the I-pod and a new name for the I-pod popped up. On top of that, it would not display my songs from my i-pod. They are not g

  • PM06 capital order release error

    HI Guys, I have created the PM06 capital order for the functional location and when I try to release the order I'm getting error message like this "You cannot use asset class 4001 for capital-investment measures Message no. AY106" Diagnosis You have

  • Subscription Purchase

    If I purchase an annual subscrition of a magazine in a DPS multi-edition viewer when do I receive my first edition? Do I get the latest available edition in the library or do I need to wait until the next edition is published? It's a bit of a let dow

  • Ayuda xfavor

    Descargue la actualización en mi celular Android, y a partir de ahi cada vez que intento descargar un pdf no lo habre xk dice que no reconoce mi tarjeta SD y tengo memoria ya la saque y la meti al igual que desistale la aplicacion una y otra vez