LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cron tab, what do you use it for? (https://www.linuxquestions.org/questions/linux-newbie-8/cron-tab-what-do-you-use-it-for-486964/)

Fritz_Monroe 09-25-2006 09:24 PM

cron tab, what do you use it for?
 
We use cron tabs at work to schedule various scripts, but what would I use this for at home? I know I can use it to schedule a backup or that sort of thing.

But what I'm curious about is what everyone uses cron tabs for. What do you schedule on your home computer?

This is just a curiosity type of thing. I'm also wondering if I'm missing something. Could I be making better use of my system?

Thanks

F_M

Penguin of Wonder 09-25-2006 11:07 PM

I use it to sync my portage tree. Logroller uses it for me. I also plan on using it to run "updatedb" on a regular basis, but I haven't got to it yet. There are a lot of other things you can do with it I have no need for as of right now. On the same hand though there a lot of things I can do with it I just don't right now.

speck 09-26-2006 12:17 AM

Some of the processes in my crontab (most run nightly):
Download new patches from Slackware mirror
Download various podcasts
Download new virus definition files
Run virus scanner

The above processes also send an email if any action was taken (file downloaded, virus found, etc.) or any errors occurred.

Penguin of Wonder 09-26-2006 08:10 AM

I don't have any of mine send me e-mail. I run them on good faith :-), that is a good idea though.

michaelk 09-26-2006 08:42 AM

My lawn sprinkler system runs via cron.
Some of my outside lights turn on via cron based on sunset times.

Fritz_Monroe 09-27-2006 07:20 PM

Never thought about the podcasts, good idea.

And michaelk, do you have your house automated?

michaelk 09-27-2006 07:47 PM

Yes, its still a project in work.

Nylex 09-28-2006 03:32 AM

Currently, I have cron jobs set up to update the locate database and do log rotation (these were already set up in Slack, I just had to change the settings so they'd run at a more convenient time). I'll set one up for removing temp files, too.

Penguin of Wonder 09-28-2006 07:42 AM

I found a wiki article on removing the temp files using cron on the Gentoo Wiki. How safe is that? Is there something I need to watch out for when removing temp files?

Nylex 09-28-2006 09:55 AM

I was also wondering about how safe it is, which is why I've not made a job yet.

xpromisex 09-28-2006 10:24 AM

I have my crontab set up to run Archstats (a stat reporting program for Arch Linux), download and install the latest packages for Arch, and as an alarm to wake me up most mornings.

DotHQ 09-28-2006 11:44 AM

I wrote a little script which copies the /root/.bash_history file to a backup location and append the date to the filename. I also insert date into the .bash_history file so I know what day commands were run. This comes in handy at times.
I run the script once a day via cron.

I also use cron to run a script to check for disk space availability. (df -h) And it emails me if the output of the df is over 75%.

soggycornflake 09-28-2006 02:54 PM

Quote:

Originally Posted by DotHQ
I also insert date into the .bash_history file so I know what day commands were run. This comes in handy at times.

Hmm, you might want to check out the HISTTIMEFORMAT environment variable. I use zsh myself so I don't know if that's what you're looking for. From bash man page:

Quote:

If this variable is set and not null, its value is used as a format string for strftime(3) to print the time stamp associated with each history entry displayed by the history builtin. If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions.
I'm currently using crontab to record TV (dvb) because I can't be arsed to install MythTV/etc, I just wrote a couple of wrapper scripts around mencoder.


All times are GMT -5. The time now is 04:16 PM.