Visit Our UNIX and Linux User Community


Snapshot of part of the cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Snapshot of part of the cron
# 1  
Old 07-06-2001
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  
Old 07-06-2001
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  
Old 07-06-2001
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  
Old 07-06-2001
Got it Smilie

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  
Old 07-07-2001
hI Neo,

Can you kindly help my giving an example.
Much appreciated.
Smilie
# 6  
Old 07-07-2001
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.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #850
Difficulty: Medium
Every Bluetooth device has a unique 48-bit address.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to make a loop to read the input from a file part by part?

Hi All, We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)
Discussion started by: arun_adm
6 Replies

2. Solaris

Snapshot analyze

Hi, Is there any tool is available for analyzing Oracle X86 snapshot output. Thanks in advance. (1 Reply)
Discussion started by: sunnybee
1 Replies

3. OS X (Apple)

Snapshot backup

Hi all: I'm trying to do the following: 1) Each monday (for every week or bi-weekly) I'll perform a full backup of my 2 Tb RAID 1 system to an external eSATA 2 Tb HDD. I'll move this HDD to a different physical place (my home i.e). 2) Each day after monday until the next backup, I want to... (3 Replies)
Discussion started by: alvgarci
3 Replies

4. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

5. Solaris

zfs - get the name of the last snapshot

I have installed Solaris 11 Express on my server and want to set up automatic backuping using zfs snapshots. In the backup script I need to find out the name of the last snapshot of the given filesystem (in order to refer to it as the startpoint of an incremental backup). What is the best way to do... (4 Replies)
Discussion started by: RychnD
4 Replies

6. Solaris

Can not snapshot zone

For the life of me, I cannot figure out the syntax unless it's my configuration. Zone path is /zpool/zones/oracle11zone2 It is not running. -bash-3.00# zfs snapshot zpool/zones/oracle11zone2@prepatch cannot open 'zpool/zones/oracle11zone2': dataset does not exist -bash-3.00# zfs snapshot... (13 Replies)
Discussion started by: LittleLebowski
13 Replies

7. Linux

LVM snapshot question

Hi All, I am planning to do a LVM replicate to another server. Example : server1.foo.com has / , /boot , swap and few LVM partitions. All are in /dev/sda disk of size 80GB. /dev/sda5 is a LVM partition which has only one vg00 and it has 2 LV's (/var and /usr) and a SAN storage connected to... (0 Replies)
Discussion started by: rakrhn
0 Replies

8. Shell Programming and Scripting

comment out a cron job as part of a script

Greetings, I am creating a ksh script to automate the installation of a utility on many servers. As part of this install, I want to check for a job in root's crontab. If the job exists, I need to comment it out. I know I will need to copy off the crontab then read it back in, but I am... (4 Replies)
Discussion started by: 22blaze
4 Replies

9. Shell Programming and Scripting

comparing part of header with part of detailed records.

Hi there, I am lil confused with the following issue. I have a File, which has the following header: IMSHRATE_043008_101016 a sample detailed record is :9820101 A982005000CAVG030108000000000000010169000MAR 2008 9820102 MAR 2008 D030108 ... (1 Reply)
Discussion started by: cmaroju
1 Replies

10. Solaris

FS snapshot problems

Hi, I'm working with fssnap command because I would search an alternative backup metod. My server has Solaris 9 installed and following sys admin manual, I created some snapshots, this is not difficult. But the problem is here: following manual I create without problem snapshots, for example the... (1 Reply)
Discussion started by: bonovox
1 Replies

Featured Tech Videos