2023-05-20 20:22:23 +00:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
2023-05-13 18:25:45 +00:00
|
|
|
total_count=0
|
|
|
|
declare -a crontab_dirs=(
|
|
|
|
/etc/cron.d
|
|
|
|
/etc/cron.daily
|
|
|
|
/etc/cron.hourly
|
|
|
|
/etc/cron.weekly
|
|
|
|
/var/spool/cron
|
|
|
|
)
|
|
|
|
|
2023-05-20 20:22:23 +00:00
|
|
|
echo "Crontab Statistics: <br>"
|
2023-05-13 18:25:45 +00:00
|
|
|
for dir in ${crontab_dirs[@]}; do
|
|
|
|
count=0;
|
|
|
|
for file in $dir/*; do
|
|
|
|
count=` ls -1 $dir | wc -l `
|
|
|
|
done
|
|
|
|
echo "- $dir: $count<br>"
|
|
|
|
total_count=$(( $count + $total_count ))
|
|
|
|
done
|
|
|
|
|
2023-05-20 20:22:23 +00:00
|
|
|
echo "Total: $total_count"
|