Schedule on-demand tasks with ONTAP Vscan
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.
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.
- 
Schedule an on-demand task:
vserver vscan on-demand-task schedule -vserver data_SVM -task-name task_name -schedule cron_scheduleThe following command schedules an on-access task named
Task2on thevs2SVM: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.
Learn more about
vserver vscan on-demand-task schedulein the ONTAP command reference.To view the status of the job, use the job showcommand. Thejob pauseandjob resumecommands, respectively pause and restart the job; thejob stopcommand terminates the job. Learn more aboutjobin the ONTAP command reference. - 
Verify that the on-demand task has been scheduled:
vserver vscan on-demand-task show -instance data_SVM -task-name task_nameLearn more about
vserver vscan on-demand-task showin the ONTAP command reference.The following command displays the details for the
Task 2task: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 
You must enable scanning on the SVM before the task is scheduled to run.