LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
... 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: 687
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

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: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
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 (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
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
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,310
Blog Entries: 28

Rep: Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136
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
Posts: 1,385

Rep: Reputation: 275Reputation: 275Reputation: 275
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 15 64bit on Desktop Slackwarearm on Raspberry PI v1b
Posts: 381

Rep: Reputation: 38
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: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
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
LQ Veteran
 
Registered: May 2008
Posts: 6,896

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
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: 621

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration