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.
crontab [-u username] -l (this command will list a specific user's crontab)
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)
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]#
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 -l30 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
Reviewed by Admin
on
15:04:00
Rating: