Skip to main content

Schedule an on-demand task

Contributors netapp-ahibbard netapp-powr

You can create a task without assigning a schedule and use the vserver vscan on-demand-task schedule command to assign a schedule; or add a schedule while creating the task.

About this task

The schedule assigned with the vserver vscan on-demand-task schedule command overrides a schedule already assigned with the vserver vscan on-demand-task create command.

Steps
  1. Schedule an on-demand task:

    vserver vscan on-demand-task schedule -vserver data_SVM -task-name task_name -schedule cron_schedule

    The following command schedules an on-access task named Task2 on the vs2 SVM:

    cluster1::> vserver vscan on-demand-task schedule -vserver vs2 -task-name Task2 -schedule daily
    [Job 142]: Vscan On-Demand job is queued. Use the "job show -id 142" command to view the status.

    To view the status of the job, use the job show command. The job pause and job resume commands, respectively pause and restart the job; the job stop command terminates the job.

  2. Verify that the on-demand task has been scheduled:

    vserver vscan on-demand-task show -instance data_SVM -task-name task_name

    For a complete list of options, see the man page for the command.

    The following command displays the details for the Task 2 task:

    cluster1::> vserver vscan on-demand-task show -instance vs2 -task-name Task2
    
                               Vserver: vs2
                             Task Name: Task2
                    List of Scan Paths: /vol1/, /vol2/cifs/
                 Report Directory Path: /report
                          Job Schedule: daily
    Max File Size Allowed for Scanning: 5GB
                File Paths Not to Scan: /vol1/cold-files/
           File Extensions Not to Scan: mp3, mp4
               File Extensions to Scan: vmdk, mp*
          Scan Files with No Extension: false
               Request Service Timeout: 5m
                        Cross Junction: true
                   Directory Recursion: true
                         Scan Priority: low
                      Report Log Level: info
After you finish

You must enable scanning on the SVM before the task is scheduled to run.