shortname=$(hostname | cut -d'.' -f1) if [ ! -d /etc/cron.weekly ]; then mkdir /etc/cron.weekly fi echo "/usr/bin/find / -perm -4000 2>/dev/null > /tmp/suid_list-${shortname}.\$(date +"%m%d%Y-%H%M%S")" > /etc/cron.weekly/suidcheck.sh echo "/usr/bin/find / -perm -2000 2>/dev/null > /tmp/sgid_list-${shortname}.\$(date +"%m%d%Y-%H%M%S")" > /etc/cron.weekly/sgidcheck.sh echo "/usr/bin/find / -type b -o -type c 2>/dev/null > /tmp/device_list-${shortname}.\$(date +"%m%d%Y-%H%M%S")" > /etc/cron.weekly/devcheck.sh chmod 700 /etc/cron.weekly/* /bin/kill $(cat /var/run/crond.pid) /bin/echo "30 0 * * 0 /etc/cron.weekly/suidcheck.sh" >> /var/spool/cron/crontabs/root /bin/echo "35 0 * * 0 /etc/cron.weekly/sgidcheck.sh" >> /var/spool/cron/crontabs/root /bin/echo "40 0 * * 0 /etc/cron.weekly/devcheck.sh" >> /var/spool/cron/crontabs/root /bin/crond