Cron jobs can be very useful to automate repetitive tasks. Users that set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.
Some of the basic examples include running scheduled backups, monitoring disk space, deleting files (for example log files) periodically, running system maintenance tasks and a lot more.
What do you use Cron jobs for?
Oldest comments (25)
I recently used cron jobs for two main things: to retrieve the latest issues of our clients to display them on a custom interface, and to update the list of pages of a website in a solr backend (full text search application).
Sounds interesting.. What's that solr project is about? and how you use it?
Could you add something about it?
Sounds interesting as I have solr project as well..
We created a package that we use with django-haystack in order to index Django-based sites pages.
When our customers post new content on their sites they just have to wait a few hours before it is crawled and available in the search index.
I use cronjob for a timely backup session with Equilibrium. Clean up and sorting files that I saved everywhere in my workstation and laptop with Sweep. It helps to reorganize files automatically into specific directories.
Linux crontab:
pm2 cron:
GitHub cron:
Ah... I used to create a tool to monitor
COVID-19
situations in my Terminal. Go check that out.Technically I use anacron, but it's the same principle. I only use it to setup a little reminder that I need to update the system (the one I use for work, not a server).
Usually Cronjob script is need for doing same work every period that its needs. For example, getting some blockchain transaction every seconds. For practice purpose, Shared Server didn't support well for Cronjob. If you are trying to use cronjob script, You need to purchase VPS Server or Dedicated Server π
We use crontab for cleaning up yarn logs, general housekeeping stuff. Invoking batch processing programs which are not time critical
I've got a cron running to update my Twitter username with the current weather. Runs every 20 mins.
I use them for all kinds of things depending on the machine and its use, but one of one's I always use on every machine is for running
updatedb
formlocate
as root every so often. I work on many projects often and it's hard to keep track of everything. For example:I might work on 4 or 5 Fortran projects within a couple days and on both of my Linux and Windows partitions and say I need my last modified module file and I don't remember which project I did last so I'll run my
lastmodified
program which is dependent onmlocate
being updated and with a cron job I don't ever have to worry about it.I used cron jobs to renew let's encrypt certificate, import currency rate and impott data from remote APIs