Comment 7 for bug 46493

kko (kko) wrote :

The idea of cron being able to execute scripts that are not executable was bizarre enough that I had to verify it myself. On this machine, Kubuntu Breezy, removing the executable bits from a script in cron.{daily,monthly} with "sudo chmod a-x" _definitely_ prevents it from running - quite as would be expected.

Are you absolutely sure of your test results?

A simple test to verify cron's workings:
cd /etc/cron.hourly
sudo nano crontest

Insert the following two lines and save the file:
#!/bin/sh
date >> /tmp/crontest.log

sudo chmod a+x crontest
./crontest (to verify that the script works)

Now, open up a new terminal, and type "tail -f /tmp/crontest.log", and wait for the cron.hourly to execute at least once, to verify that cron works. (Optionally, if you know your cron works, skip this part and go directly to the next.)

Then, "sudo chmod a-x /etc/cron.hourly/crontest", and keep the "tail" open for a couple hours (or check back after that time), and see if the crontest script still got executed. (Note also that /tmp gets cleared at shutdown/startup.)