---
title: Jenkins流水线病毒扫描示例代码
description: "示例代码如下："
url: https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/pipeline/NativeDevelopment_0124.html
sourcePath: /source/zh/nativedevp/userguide/pipeline/NativeDevelopment_0124.html
indexId: 2661e970319e250f6783053c83fd4dd2a400e799d487cf46a61b35db2f1e8b5968
---
# Jenkins流水线病毒扫描示例代码

示例代码如下：

```
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
}
stages{
stage('freshclam') {
agent {
label 'kunpeng_executor'
}
steps{
sh 'freshclam'//若为普通用户，请在命令前添加sudo命令
}
}
stage('clamscan') {
agent {
label 'kunpeng_executor'
}
steps{
sh 'clamscan -i -r /home -l
~
/clamscan.log'//若为普通用户，请在命令前添加sudo命令
}
}
}
}
```
