This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

videos are not archived

Hello! I configure video archiving according to this instruction www.netiq.com/.../win_vid_capture.html
I pasted the code from the example into Rollover Script.
Created the / opt / netiq / npum / service / local / audit / videobck / folder, but no archives are created
  • 0  

    Try the following instead:

    use warnings;
    use File::Copy; 

    if ($DBGRP eq 'cmdctrl') {
        my $srcdir = ($^O eq "MSWin32") ? "C:/Program Files/Netiq/npum/service/local/audit/video/capture/" : "/opt/netiq/npum/service/local/audit/video/capture/";
        my $dest = ($^O eq "MSWin32") ? "C:/Program Files/Netiq/npum/service/local/audit/videobck/" : "/opt/netiq/npum/service/local/audit/videobck/";

        my $fileage = 1;     #Age in days 

        opendir(DIR, $srcdir) or die $ctx->log_error("Can't open $srcdir: $!");
        my @files = grep {!/^\.+$/ } readdir(DIR);
        foreach my $file (@files) {
            my $old = "$srcdir/$file";
            if( (-f $old) && ($fileage< -M $old) ) {
                move($old, $dest) or die $ctx->log_error("Move $old -> $dest failed: $!");
            }
        }  
        close(DIR);
        $ctx->log_info("Backup Complete");
    }
  • 0 in reply to   

    Thanks for the tip! But this code is from the example and I am using it. It doesn't work for me

  • 0   in reply to 

    No, the code I pasted above is slightly different than the one from the example in documentation. The example in documentation needs to be corrected.

  • 0 in reply to   

    Please help to show the different points. I got the code of you but it doesn't work

  • 0   in reply to 

    I believe the above code to have the corrected syntax and suspect it's relating to when the script executes. When the rollover script is changed and that configuration saved, it does not run or execute the script immediately afterwards. It is a rollover script that will be executed at the time the next audit rollover event takes place. This event takes place as configured in the Audit Log Settings for rollover in the Audit Settings. For example, "Time (Hours)" and "Size (Mb)" are trigger points for when the audit rollover takes place and then the rollover script will execute afterwards. So I suspect that when you state it isn't working here, you are saying that the anticipated video files were not moved. So I suspect this just means that the audit rollover event hasn't occurred yet and thus the script hasn't been executed. 

    I suggest opening a case with Support so the unifid.log can be analyzed to know if the rollover script has been executed, if there is any syntax problem preventing it from being executed, etc. More information can be found from the log.

  • 0 in reply to   

    Thanks for the help! Yes, your code works. Moves files to another folder.
    But how to make sure that files are deleted after six months?
  • Suggested Answer

    0   in reply to 

    For some audit rollover examples, see the following document for various contexts:

    See TID 7023283 - How to configure rollover scripts to manage logs and audits

    For your example here, where you are aiming to expire/delete video audits after 6 months, you can simply tweak the behavior in the sample script provided you are using so that instead of a move, it performs a delete. I think just the following adjustments:

    1. Change the fileage to 6 months instead of 1 day. E.g.
      $fileage = 180;

    2. Replace the "move" line of code to do an "unlink" / delete instead.

      Replace the current behavior found in the script
      move($old, $dest) or die $ctx->log_error("Move $old -> $dest failed: $!");

      with the line below to remove instead of move
      unlink $old;