用 run-parts 运行目录中的脚本
像 cron 一样执行或列出目录里的可执行脚本。
运行 run-parts --test /etc/cron.daily,列出将会执行的脚本。
01命令
命令
$ run-parts --test /etc/cron.daily02作用说明
run-parts 按字典序运行目录中的每个可执行文件,这正是 /etc/cron.daily 等目录的工作方式。用 --test 预览列表,让定时维护变得可调试而非黑盒。
03风险
!注意: 只有符合其命名规则的文件才会运行,且以调用者权限执行。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- run-parts.8.en.html manual page (Debian bookworm)依据: Documents run-parts, which executes scripts in a directory in sorted order.
最后验证: 2026-10-13 · 分类: 系统与设置