Wednesday, September 2, 2015

RHEL7 - Crontab Example

1. Add cron entry for a root user
# crontab -e
23    22    *    *    *    /bin/echo    "Hello, World !!!"

2. Add cron entry for a user
# crontab -eu sarah
23    14    *    *    *    /bin/echo    "hyer"
3. To deny a user from running cron
# vi /etc/cron.deny
john

systemctl status crond
systemctl enable crond
# systemctl start crond

3. Login as a deny user and run the crontab -l, you should get permission deny error
# su - john
$ crontab -e

No comments:

Post a Comment