Sponsored Content
Full Discussion: Parsing cron data with awk
Top Forums Shell Programming and Scripting Parsing cron data with awk Post 302766477 by Elvirnith on Monday 4th of February 2013 09:43:15 PM
Old 02-04-2013
The script is only going to run once a week. I'm not interested in anything that runs every 15 minutes or greater. If a script runs on Friday at 2 pm, it should be ignored. Now, if a script is supposed to run on Friday every 5 minutes, then that of course could be something I want to see.

That being said, there are so many potential combinations that some of them are unrealistic for the scope of what I'm trying to do here. I basically just need to say that, if a script is set to execute between 1 and 14 minutes in frequency every hour, every day of the week then it should be flagged. However, if it's set to execute every hour at 5 past the hour then it should be ignored. Likewise with daily/weekly.

I'm wondering if potentially using additional regex's for the other columns would be a viable way to go. i.e. if * or 1 - 9 is found in columns 2, 3, 4, or 5 then exclude this cron from the list.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parsing XML dynamic data via awk?

I am trying to use a line of output in an XML file as input in another new XML file for processing purposes via a shell script. Since I am a newbie though, I'm not sure how to do this since the data is different everytime. I am using this technique with static data right now: echo -n "Running... (5 Replies)
Discussion started by: corwin43
5 Replies

2. Shell Programming and Scripting

Parsing the data

Hi I need to parse the following data using shell script Table ----- stage4n_abc 48 stage4o_abcd 4 adashpg_abc_HeartBeat 1 stage4l_asc 168 Can anyone gimme the solution. I want each value to get stored in an array or variable and want the value to be greped from another file.... (1 Reply)
Discussion started by: Archana.Dheepan
1 Replies

3. Shell Programming and Scripting

Question about Awk for Data Parsing

Hi, I am doing some data parsing for some economics research. I was recently exposed to shell script and am brand new to awk. I have a large csv file (like 10G) and I would like to make it a lot smaller with awk, but it is a bit tricky for me and I haven't been able to get it yet. I would... (5 Replies)
Discussion started by: EconResearch
5 Replies

4. Shell Programming and Scripting

Parsing data

Hi all , I have a file with billing CDR records in it. I need to parse that information (row format) . The purpose is to compare full content. The example I have given below is a single line record but it has two portions, (1) the line start with “!” and end with “1.2.1.8” and (2) second part... (5 Replies)
Discussion started by: jaygamini
5 Replies

5. Shell Programming and Scripting

Parsing cron with sed

Hello I want to convert my cron list into a csv Can you please help me with sed ? eg: Convert #06,21,36,51 * * 1,2 * (. ~/.profile ; timex /some/path/script -30 -15) >> /some/path/logfile2 2>&1 * * * * * (. ~/.profile ; timex /some/path/script2) > /some/path/logfile2 To:... (1 Reply)
Discussion started by: drbiloukos
1 Replies

6. Shell Programming and Scripting

Parsing the data

Hi friends, I need to parse the following data in the given format and get the desired output. I need a function, which takes the input as a parameter and the desired output will be returned from the function. INPUT(single parameter as complete string) A;BCF;DFG;FD ... (3 Replies)
Discussion started by: sumesh.1988
3 Replies

7. Shell Programming and Scripting

Help in Parsing data

I have below string Transaction_ID:SDP-DM-151204679 , Transaction_DateTime:2011-02-11 00:00:15 GMT+05:30 , Transaction_Mode:WAP , Circle_ID:4 , Circle_Name:BJ ,Zone: , CustomerID:B_31563486 , MSISDN:7870904329 , IMSI:405876122068099 , IMEI: , Sub_Profile:Pre-Paid , CPID:Nazara , CPNAME:Nazara ,... (6 Replies)
Discussion started by: poweroflinux
6 Replies

8. Shell Programming and Scripting

Data parsing

Hi, I do have a data file which is divided into compartments by ---------. I would like to extract (parse) some of the data and numbers either using awk or sed The file has the format: CATGC Best GO enrichment: Genes/ORF that have the motifs (genes are sorted by max(pa+pd+po)): ... (6 Replies)
Discussion started by: Lucky Ali
6 Replies

9. Shell Programming and Scripting

Help with parsing data with awk , eliminating unwanted data

Experts , Below is the data: --- Physical volumes --- PV Name /dev/dsk/c1t2d0 VG Name /dev/vg00 PV Status available Allocatable yes VGDA 2 Cur LV 8 PE Size (Mbytes) 8 Total PE 4350 Free PE 2036 Allocated PE 2314 Stale PE 0 IO Timeout (Seconds) default --- Physical volumes ---... (5 Replies)
Discussion started by: rveri
5 Replies

10. Shell Programming and Scripting

Parsing XML (and insert data) then output data (bash / Solaris)

Hi folks I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file. It all works - apart from the xml and config file format in the new file with XML files the original XML (that ends up in... (2 Replies)
Discussion started by: dfinch
2 Replies
at(1)							      General Commands Manual							     at(1)

Name
       at, batch - execute commands at a later time

Syntax
       at time [day] [file]
       at -r job...
       at -l [job...]

       batch [file]

Description
       The  and commands use a copy of the named file (standard input default) as input to or at a later time.	A command to the current directory
       is inserted at the beginning, followed by assignments to all environment variables.  When the script is run, it uses the user and group	ID
       of the creator of the copy file.

       The command allows the user to specify when the commands should be executed, while jobs queued with execute when the load level of the sys-
       tem permits.

       The environment variables, current directory, and are retained when the commands are executed.  However, open files,  traps,  and  priority
       are lost.

       Users are permitted to use the and commands if their name appears in the file If that file does not exist, the file is checked to determine
       if the user should be denied access to and If neither file exists, only the superuser is allowed to submit a job.  If only the file  exists
       and is empty, global usage is permitted.  The files consist of one user name per line.

       The  time  is  1  to 4 digits.  It can, but does not have to be, followed by A, P, N or M which stand for AM, PM, noon or midnight, respec-
       tively. The A, P, N, and M suffixes are case-insensitive.  One and two digit numbers are interpreted as hours, three and four digits to	be
       hours  and  minutes. If three digits are specified, the first digit is interpreted to be an hour in the range 0-9, and the second and third
       digits as minutes.  If no letters follow the digits, a 24 hour clock time is presumed.

       In addition to 1-4 digits, and suffixes A, P, M, N, you can also specify:
       at hh:mm
       at h:mm
       at ham
       at hpm
       at noon
       at midnight

       The optional day is either a month name followed by a day number or by a day of the week.  If the word week  follows,  the  or  command	is
       invoked in seven days.  Both commands also recognize standard abbreviations for the days of the week and months of the year.  The following
       are examples of legitimate commands:
       at 8am jan 24

       at 1530 fr week

       The programs are executed by periodic execution of the command from The granularity of depends upon how often atrun is executed.  The  com-
       mand examines the file every minute.  The file determines when is executed.  The default is every 15 minutes on the 1/4 hour. Editing makes
       run more or less frequently.

       Standard output or error output is lost unless it is redirected.

       The and commands write the job number to standard error.

Options
       -r		   Removes jobs previously scheduled by or The number is the number reported at invocation by or  Only	the  superuser	is
			   allowed to remove another user's jobs.

       -l		   Lists all job numbers for all jobs submitted by the user issuing the command.  Even if the user is "root", only numbers
			   for jobs submitted by "root" are displayed.	To see the numbers of all jobs submitted, enter the following command:
			   % ls -l /usr/spool/at

Restrictions
       Due to the granularity of the execution of there may be bugs in scheduling jobs almost exactly 24 hours into the future.

Diagnostics
       Complains about various syntax errors and times that are out of range.

Files
       /usr/lib/atrun	   executor run by cron(8)

       in /usr/spool/at:
	    yy.ddd.hhhh.*  activity for year yy, day dd, hour hhhh.
	    lasttimedone   last hhhh
	    past	   activities in progress
       /usr/spool/at/at.allowlist of allowed users
       /usr/spool/at/at.denylist of denied users
       /usr/spool/at	   spool directory
       /usr/lib/cron	   XOPEN compatibility

See Also
       crontab(5), cron(8)

																	     at(1)
All times are GMT -4. The time now is 04:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy