I have some shell code that I'd like to execute daily using cron. Currently, I have the entire code written as a one-liner, and the 6 variations (each designed to run at different times) are all written in the crontab. While this works, it's quite difficult to read, and could be made more efficient by putting the code in a shell script, and running the script with cron.
However, I need to put the script somewhere. I cannot find anything in the man pages or online specifying the 'proper' location for cron jobs. Is there a directory in
/etc for cron jobs? Or should I use root permissions to put my script in
/usr/lib/cron/jobs/? Should I put the script in
~/.bin/ and use the full path in my crontab?
When I ask where I 'should' put it, I am looking for the location that is designated by the implementation of cron, or, if that doesn't exist, the location that makes the most sense and is most secure.
Note: the script needs no special permissions, just to run as me.