Script placed in cron.daily is not running? try removing its file extension
23 Aug
OK, that was a major annoyance!. I found a nice mysql backup script, changed all the constant which define the DB names, user, password and backup path, run it from the terminal and everything looked great. The following day I have checked the backup and there was no automatic backup done!
I have checked that all the paths in the script are absolute, and the script is executable and it has enough permissions to run, even changed the location of backup files, but still nothing happened.
For two months I have run the script manually when I happened to log into the server, but to day I woke up determined to stop this nonsense and try to find the root cause and solution to this problem.
After some googling and reading deep into some forum discussions I have discovered that the “run-parts” script which is the real engine behind executing the script in cron.daily don’t know how to handle files with extensions
, and I used a .sh extensions for the backup file since I like the name of the file to express as much as possible its content.
This was a major PITA. You expect the extension part to be significant on windows but not on Unix, and this is not documented in any of the major documentation sites of Linux and Ubuntu …. Well, at least now there is a blog post about this…….