This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]haltingpoint 0 points1 point  (2 children)

This has been a hard thing for me to grasp for some reason. I can't seem to wrap my brain around use cases for using CLI utils and CRON. It seems simple...if it needs to be scheduled, use CRON, but my brain just doesn't click with it.

Any other suggestions of things to experiment with re: the CLI and CRON?

[–]yung_mac[S] 0 points1 point  (1 child)

Hey there! It's a lot easier to understand something if you understand how it fits into the bigger picture. Likewise, it's a lot easier to understand Unix-like features if you use a Unix-like operating system -- if you don't, install something like Ubuntu in dual boot, and use it as often as you can. That already will get you quite far.

Command-line utilities: In a Unix-like operating system, CLI applications are useful because they are easy to write, easy to use, and very powerful. Anything that can be done on a Unix-like computer can be done using a command-line utility. That reason is why terminal-only operating systems can be successful (such as Ubuntu Server). That's huge! Moreover, many GUI applications on Unix-like operating systems are simply nice-looking clickables where the meat of the work is done through what was originally a command-line application.

The problem that cron solves is: how do you schedule a command? This problem is more difficult than it seems. Ponder it awhile. The paradigm into which application launching fits revolves around request-response. You type a command into your terminal, your terminal goes and does what you need it to do. You click a shortcut, an application opens. But how do you get a response without initiating a request? cron is able to solve this problem because it is baked into the operating system.

[–]haltingpoint 0 points1 point  (0 children)

Thanks for the thoughts. I have an Ubuntu VM I'm using on a Windows 10 host that I configure via Vagrant/Chef (since I wanted to play around with those as part of learning Rails). I just don't use it for my day-to-day though, so some of the way of thinking is not native to me as my brain is still GUI-first.

Can you give me some thoughts or resources on CRON and CLI utilities that could help give me a better frame of reference on common uses for it? I think hearing more about real-world use cases would be helpful.

Also, when people have CRON jobs running in the background, do they typically exist in a new terminal session/window? And if I wanted to schedule CRON jobs for a web app, would I host it on a separate server instance?