系统管理指南:高级管理

Procedure如何验证 crontab 文件是否存在

  1. 要验证用户的 crontab 文件是否存在,请在 /var/spool/cron/crontabs 目录中使用 ls -l 命令。例如,以下输出说明用户 jonessmithcrontab 文件存在。


    $ ls -l /var/spool/cron/crontabs
    -rw-r--r--  1 root     sys          190 Feb 26 16:23 adm
    -rw-------  1 root     staff        225 Mar  1  9:19 jones
    -rw-r--r--  1 root     root        1063 Feb 26 16:23 lp
    -rw-r--r--  1 root     sys          441 Feb 26 16:25 root
    -rw-------  1 root     staff         60 Mar  1  9:15 smith
    -rw-r--r--  1 root     sys          308 Feb 26 16:23 sys

    使用 crontab -l 命令验证用户的 crontab 文件的内容,如如何显示 crontab 文件中所述。