34 lines
747 B
Markdown
34 lines
747 B
Markdown
### 定时任务
|
|
|
|
```yaml
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: sync-guess-content-to-db
|
|
namespace: cron
|
|
spec:
|
|
schedule: "30 9 * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: sync-guess-content-to-db
|
|
image: busybox:1.36
|
|
imagePullPolicy: IfNotPresent
|
|
command: ["/bin/sh"]
|
|
args:
|
|
- -c
|
|
- "/data/nd-feedback-offline-go -i /data/config.yaml -c SyncGuessContent2DB"
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
volumes:
|
|
- name: data
|
|
hostPath:
|
|
path: /root/cron
|
|
type: Directory
|
|
```
|
|
|