0

I understand that cron is basically a job scheduler. Apart from doing $sudo apt update which I like/love to run manually as it's uncertain when my bandwidth will be free for running the update, I don't know of any programs which would be useful to run via cron. In a SOHO environment, where I don't run LAMP, is crontab useful, if yes, which programs would benefit from it ? Are there any user applications which would benefit from it being in cron ?

I am on Debian.

2
  • 1
    It's useful for anything you want to schedule, if you have nothing to schedule then it is not useful. I don't understand your question. Commented Jan 12, 2016 at 11:35
  • I basically want to understand if there are any low-hanging fruit (or apps.) where cron could be used in a non-server environment. I can understand where it is used to rm old throwaway logs in server environments, was thinking to see if there are any programs which could benefit from the same. Commented Jan 12, 2016 at 11:40

2 Answers 2

1

In case you are using one or more SSD's, it may be beneficial to run the fstrim-all command regulary instead of using the discard mount option.

When the discard mount option is used, a TRIM command is sent to the SSD each time a file is deleted. This command tells the SSD to really delete blocks that have been marked for deletion. Some have reported that this decreases disk performance, but I have not yet tested it myself.

Ubuntu (since 14.04) already comes with the follwing entry in /etc/cron.weekly/:

#!/bin/sh # call fstrim-all to trim all mounted file systems which support it set -e # This only runs on Intel and Samsung SSDs by default, as some SSDs with faulty # firmware may encounter data loss problems when running fstrim under high I/O # load (e. g. https://launchpad.net/bugs/1259829). You can append the # --no-model-check option here to disable the vendor check and run fstrim on # all SSD drives. exec fstrim-all 

So a TRIM command is sent to the SSD once a week instead of on every file deletion. By doing so, single deleteions are faster, and the drive will stop responding for a short time due to trimming only once a week, which you probably won't even notice.

0

Tasks as:

  • Backups
  • Maintenance of log, cache, etc.
  • Database maintenance
  • Download of high volume data

can be programmed trough cron to be executed on certain times when they don't disturb usual tasks of the server,

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.