The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
FS snapshot problems bonovox SUN Solaris 1 04-24-2008 03:59 PM
disk errors with san snapshot robsonde Filesystems, Disks and Memory 0 04-21-2008 12:17 AM
NoBug 0.3rc1 (Snapshot branch) iBot Software Releases - RSS News 0 04-03-2008 12:50 PM
taking snapshot of a file bryan UNIX for Dummies Questions & Answers 1 09-09-2005 11:42 AM
Fedora Core 2 Snapshot HOUSCOUS Linux 0 05-17-2004 11:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-06-2001
rooh rooh is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 62
Question Snapshot of part of the cron

Hi all,

I hope somebody will be able to help me soon.
Actually I want to write a small function whereby I will be able to take a snapshot of a part of the crontab.
For ex I want to take a snapshot of the jobs that runs daily and before 11.30 am .Can anyone help me with this.If the job has been hashed out The script should still show that it was the part of the jobs to run.

Thanks.
  #2 (permalink)  
Old 07-06-2001
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,781
Crontab is a flat ASCII file. It stays the same all the time unless edited. Sorry, but could you explain what you mean by 'taking a snapshot' of an ASCII flat file that does not change unless edited.
  #3 (permalink)  
Old 07-06-2001
rooh rooh is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 62
Hi Neo,

What I actually meant was suppose I am having a menu . In the Menu there is a choice whereby I want to see only the jobs which run in the morning.
For Ex
My cron's like
30 06 * * * /home/production/abc
00 12 * * * /home/production/xyz
00 15 * * 0,2,3,4,5 /home/production/efg
57 23 14 09 * /home/production/lmn

I want to create a script which will basically show me only the jobs which run before 11.00 am.Also if somedody has edited I should be able to show me the job as hashed.

Hope that makes a bit clearer.
  #4 (permalink)  
Old 07-06-2001
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,781
Got it

You want a script that will compare some parameters, like time against the crontab file and output that info.

Thats a pretty easy job for PERL or some other scripting language. You basically set up your filters in a script (as you originally suggested) add some command line switches so you can input your parameters, read the crontab file in the script and send the results to a file.
  #5 (permalink)  
Old 07-07-2001
rooh rooh is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 62
hI Neo,

Can you kindly help my giving an example.
Much appreciated.
  #6 (permalink)  
Old 07-07-2001
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,781
I recommend a good book on shell scripting, including books like UNIX Shell Programming and others like it. These books have many examples on how to set up filters, pattern matches, read and write files. Any good book will have more than enough examples.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0