How good are you at creating new cron jobs from memory?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: How long would it take you to create a correct cron job for any given frequency without referencing
I could do it immediately for any frequency I'm given.
1
3.45%
I would need to sit and think for a minute or so.
8
27.59%
I could work my way through it in 15 minutes or less.
1
3.45%
*maybe* I could manage one on my own if it's a simple and common one
2
6.90%
I couldn't do it from memory. I would need to reference examples/documentation.
I pick what is CRon job, even though I know what it is. but I've never not once used it per se' . I have however created a script that I want ran once a week then just moved it into "cron.weekly" chmod +x scriptName -- done.
man systemd? TL;dr -> Show me how to get sysd to do this
semiOnTopic, I've seen enuf threads about "my cronjob doesn't work", because of like path needed, quoting/gobbledygook needed cuz it's in crontab, etc., to scare me into "believing" cron might likely NOT work (for me)! LQsearch: Threads Titled cron* finds 1000!
Which leads me to be terrified of the "impossible" sysdMonster (ooops, lets NOT debate/discuss/mention sysd ... How did it get in this thread in the first place... Don't answer that: it will spoil my web search ending )
semiOnTopic, I've seen enuf threads about "my cronjob doesn't work", because of like path needed, quoting/gobbledygook needed cuz it's in crontab, etc., to scare me into "believing" cron might likely NOT work (for me)! LQsearch: Threads Titled cron* finds 1000!
99.999% of crontab problems are from people who don't realize cron doesn't parse the system-wide or per-user shell setup scripts (.bashrc or similar) before executing, and therefore doesn't share all of the environment variables they're used to working with (most notably PATH). They also don't bother to redirect the output of their command to a log file, and then have no way of knowing what's wrong when it doesn't execute.
Two steps will eliminate basically all cron problems:
1) Run "export PATH=/usr/bin:/bin" before running the cron command interactively on your shell to see if it complains about any missing programs.
2) Add " >> $HOME/logfile 2>&1" to the end of your cron command when first adding it. If things aren't working right check ~/logfile to see what the output is, otherwise you can change the redirect to /dev/null to throw it away.
Thanks #10: I'm "cured" (of my "fear")! The very next post about cron that I ran into, was a path issue, and escaping the % in date (where cron takes % as a newline: WoW!). Now I believe "that's all there is to it"! Cool!
Distribution: Deb, Mint, Slack, LFS, Fedora, Ubuntu(LXDE)
Posts: 71
Rep:
Love cron, my crontab is 80+ lines long, automation to the rescue. With lots of at for one-offs.
I also have a special pipe that runs in a dedicated term where my cronjobs output pertinent info for me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.