Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by quanta for crontab file of a deleted user

By default, userdel doesn't remove the user's cron, at, and print jobs. To do it, uncomment the following line in /etc/login.defs:

USERDEL_CMD /usr/sbin/userdel_local 

Here is an example of userdel_local script:

#! /bin/sh

if [ $# != 1 ]; then
    echo "Usage: $0 username"
    exit 1
fi

crontab -r -u $1

So, whenever you execute userdel, any cron jobs owned by the user will be remove.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>