LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-15-2012, 10:14 AM   #1
g4ry
LQ Newbie
 
Registered: Dec 2012
Posts: 20

Rep: Reputation: Disabled
What do slackers put in cron.*


I've just started looking into using cron, which I'm fairly new to linux. I've written a script to sync my time daily but was wondering what others use cron for?

Thanks
 
Old 12-15-2012, 10:50 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,218

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by g4ry View Post
I've just started looking into using cron, which I'm fairly new to linux. I've written a script to sync my time daily but was wondering what others use cron for?

Thanks
Usually for system maintenance tasks.
 
Old 12-15-2012, 11:23 AM   #3
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,080

Rep: Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797
... and see man crontab for how to write an entry.

Note, you use crontab -e to edit a crontab file.

Hope this helps some.
 
Old 12-15-2012, 12:06 PM   #4
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 133

Rep: Reputation: 35
What I have in my personal crontab:

1. remove vim/emacs backup files older than 30 days, once per day
2. get weather data from noaa for conky, twice per day
3. download any Slackware patches that exists twice a month

John
 
Old 12-15-2012, 12:55 PM   #5
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,481
Blog Entries: 6

Rep: Reputation: Disabled
Quote:
...what others use cron for?
Avoiding Repetitive Tasks.
 
Old 12-15-2012, 03:46 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,293
Blog Entries: 3

Rep: Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448
Member Response

Hi,

Or to run tasks on timely basis.
 
Old 12-15-2012, 04:02 PM   #7
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
I use cron to run every six minutes the script that among the other things downloads new mail using POP3, checks whether new patches for Slackware appeared, and stores the ChangeLog.txt file locally.
 
Old 12-15-2012, 07:55 PM   #8
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 196
Blog Entries: 13

Rep: Reputation: 113Reputation: 113
I chmod 000 /etc/cron.daily/slocate to cut down on my disks' wear-and-tear, and run an analogous command by hand perhaps three times per year.

Like you, I add rsetdate to /etc/cron.daily. On my personal server in the colo I also added a script that downloads the Slackware changelog and emails any new entries to myself and some friends:
http://ciar.org/ttk/public/slacklog.pl
 
Old 12-15-2012, 09:25 PM   #9
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 7,939

Rep: Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495
I run my podcatcher (I'm currently using podget) to pick my podcasts at 04:00 every morning.
 
Old 12-16-2012, 03:09 AM   #10
kooru
Senior Member
 
Registered: Sep 2012
Location: Italy
Distribution: Slackware, NetBSD
Posts: 1,333
Blog Entries: 5

Rep: Reputation: 262Reputation: 262Reputation: 262
Backup, update my custom motd, mail notification in case of alarm, and other things..
 
1 members found this post helpful.
Old 12-16-2012, 05:45 AM   #11
g4ry
LQ Newbie
 
Registered: Dec 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks for your replies. @w1k0, I like the idea of checking for patches and maybe mailing them to root. Other ideas I had was to periodically run programs like aide and rkhunter, or would that be better done from a live distro?

Another thing I was thinking about was retrieving gmail, does anyone do this?

Last edited by g4ry; 12-16-2012 at 05:47 AM.
 
Old 12-16-2012, 08:53 AM   #12
interndan
Member
 
Registered: Aug 2004
Location: near Marion, Ill
Distribution: Slackware 13.37
Posts: 238

Rep: Reputation: 17
I have a script in cron.daily to sync my system clock with a time server.
 
Old 12-16-2012, 08:57 AM   #13
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,293
Blog Entries: 3

Rep: Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448
Member Response

Hi,

'Time' is one that I do on a regular 'cron' task. Be sure to use a 'pool' so the load is handled properly.
 
Old 12-16-2012, 10:47 AM   #14
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
I don't make much use of cron as I'm more of a ad-hoc kind of guy. Maybe if I left my system up 24x7 then I'd do things differently, but my box sleeps when I sleep.



Quote:
Originally Posted by ttk View Post
I chmod 000 /etc/cron.daily/slocate to cut down on my disks' wear-and-tear, and run an analogous command by hand perhaps three times per year.
I think you're proably right to disable it. slocate/updatedb may make sense on a server with millions of files, but for a modern desktop/workstation that has more than enough ram to keep inodes/dirents in vfs_cache I'm not convinced a database based solution like slocate makes any sense..

I have this in my .bashrc, which I use instead and will pretty much do the same job as an "slocate -i" does without the need to run updatedb.
Code:
function qlocate()
{
    find "$HOME" /local -xdev -readable -ipath "*${1}*" 2>/dev/null
}
 
Old 12-16-2012, 01:08 PM   #15
qweasd
Member
 
Registered: May 2010
Posts: 449

Rep: Reputation: Disabled
Quote:
Originally Posted by g4ry View Post
I've written a script to sync my time daily but was wondering what others use cron for?
I mirror the host with rsync and sync the system time with sntp, both daily.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
script run fine from ./ but when put in cron does not run j-me Linux - Server 6 06-16-2012 10:02 AM
Put each daily cron task in a separate script or put them all in one script? veeruk101 Linux - Newbie 4 10-19-2011 07:10 AM
Quotas: Put quotacheck in a cron-job? kenneho Linux - Server 4 08-26-2009 02:07 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Slackware's Cron Scheduler: I'm thinking maybe I need to put in a different cron? Old_Fogie Slackware 5 11-03-2006 06:25 AM


All times are GMT -5. The time now is 10:53 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration