/usr/sbin/run-crons is a from suse copied script, which looks at some files. if this file not exist, it's run all the files in /etc/cron.*. this happens everey minute. i don't see any reason to do it like it's. Reproducible: Always Steps to Reproduce: Actual Results: an unoptimized crontab. Expected Results: an optimized crontab. here a lite-better version of crontab: ... 0 * * * * root /usr/sbin/run-crons /etc/cron.hourly 1 3 * * * root /usr/sbin/run-crons /etc/cron.daily 15 4 * * 6 root /usr/sbin/run-crons /etc/cron.weekly 30 5 1 * * root /usr/sbin/run-crons /etc/cron.monthly ... the /usr/sbin/run-crons: #!/usr/bin/perl foreach $dir (@ARGV) { opendir DIR, $dir; foreach $file (readdir DIR) { next if $file =~ /^\./; next if $file =~ /~$/; $file = "$dir/$file"; next unless -x $file; system "echo $file"; } close DIR; } it isn't the most optimized way, but a start of this.
in the script is a small bug. erase the echo and it will run correctly
we're not going to use a perl version of run-crons... doesn't work for people who don't have perl.
#!/bin/sh while [ "${*}" ] do dir="$1" shift [ -d "${dir}" ] || continue ls --color=none "${dir}" | while read file do pfile="${dir}/${file}" rfile="${file%\~}" rfile="${rfile#.}" [ -x "${pfile}" -a "${rfile}" == "${file}" ] || continue "$pfile" done done
the debian-way is very clean and easy: run-parts it's a part of sys-apps/debianutils.
closing old bugs - cronbase has progress past this.