The blog provides Network Security Tips, Tricks, How To/Procedures. Products and areas not limited to Firewalls, Security, Check Point, Cisco, Nokia IPSO, Crossbeam, SecurePlatform, SPLAT, IP Appliance, GAiA, Unix/Linux.

Linux/Unix - How To View Scheduled Job/Crontab of Specific User

Crontab command comes with a few options using which list of scheduled job or crontab of the current user's or a specific user can be viewed. Also, can be edited and deleted.


Syntax:

crontab -l (this command will list current user's crontab)
crontab [-u username] -l (this command will list a specific user's crontab)

Usage:


crontab [-u user] file
crontab [-u user] [ -e | -l | -r ]
        -e      (edit user's crontab)
        -l      (list user's crontab)
        -r      (delete user's crontab)
        -i      (prompt before deleting user's crontab)
        -s      (selinux context)



Example:

[root@Linux]# crontab -l
30 01 * * * /var/dailyjobscript1
[root@Linux]#

[root@Linux]#
[root@Linux]#
[root@Linux]# crontab -u johndoe -l
# Script to run daily at 02:30
30 02 * * * /var/dailyjobscript1
# Script to run daily at 03:30
30 03 * * * /var/dailyjobscript4
[root@Linux]#


Linux/Unix - How To View Scheduled Job/Crontab of Specific User Linux/Unix - How To View Scheduled Job/Crontab of Specific User Reviewed by Admin on 15:04:00 Rating: 5