Shell Script to grep Job File name and Log File name from crontab -l

Hello,
I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l.
#51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1
#40 17 * * * /home/oracle/refresh/refresh_ux634.sh > /home/oracle/refresh/refresh_ux634.sh.log 2>&1
In crontab -l, there are many jobs, i need to grep job name like 'refresh_ug634.sh' and corresponding log name like 'refresh_ug634.sh.log '.
I am thinking of making a universal script that can grep job name, log name and hostname for one server.
Then, suppose i modify the refresh_ug634.sh script and call that universal script and echo those values when the script gets executed.
Please can anyone help.
All i need to do is have footer in all the scripts running in crontab in one server.
job file name
log file name
hostname
Please suggest if any better solution. Thanks.

957704 wrote:
I need help how to grep that information from crontab -l
Please can you provide some insight how to grep that shell script name from list of crontab -l jobs
crontab -l > cron.log -- exporting the contents to a file
cat cron.log|grep something -- need some commands to grep that infoYou are missing the point. This forum is for discussion of SQL and PL/SQL questions. What does your question have to do with SQL or PL/SQL.
It's like you just walked into a hardware store and asked where they keep the fresh produce.
I will point out one thing about your question. You are assuming every entry in the crontab has exactly the same format. consider this crontab:
#=========================================================================
# NOTE:  If this is on a clustered environment, all changes to this crontab
#         must be replicated on all other nodes of the cluster!
# minute        (0 thru 59)
# hour          (0 thru 23)
# day-of-month  (1 thru 31)
# month         (1 thru 12)
# weekday       (0 thru 6, sunday thru saturday)
# command
#=========================================================================
00 01 1-2 * 1,3,5,7 /u01/scripts/myscript01  5 orcl  dev
00 04 * * * /u01/scripts/myscript02 hr 365 >/u01/logs/myscript2.lis
00 6 * * * /u01/scripts/myscript03  >/u01/logs/myscript3.lisThe variations are endless.
When you get to an appropriate forum (this on is not it) it will be helpful to explain your business requirement, not just your proposed technical solution.

Similar Messages

  • Tmp file locations and Log file locations

     

    I have been having a real headache too trying to get WebLogic to put all its
    log files and temporary files in directories that I specify. It seems that
    WebLogic has a mind of its own as files get created all over the place.
    Trying to configure these really basic settings has proved extremely
    awkward. Why is it such a nightmare to do?
    "Scott Jones" <[email protected]> wrote in message
    news:3af0179d$[email protected]..
    OK, I changed the relative path for the log files.
    1. I am still getting app-startip.log
    app0000.tlog
    in the root directory and not in the ./logs directory. Any other
    settings?
    2. I sill do not know how to redirect the tmp_ejbdomain.port directory.
    Any suggestions?
    Scott
    "Sanjeev Chopra" <[email protected]> wrote in message
    news:3aef0a42$[email protected]..
    "Scott Jones" <[email protected]> wrote in message
    news:3aef05be$[email protected]..
    I a domain configured and running with two applications. WLS 6 is
    placing
    the following logs for each application at the same dir level as
    config
    dir. It is also creating tmp_ejb directory at the same level.
    1. How do I tell WLS 6 to place log files in a diff directoryIn Admin Console: modify the property Server -> Configuration ->Logging ->
    FileName
    In config.xml: the 'FileName' attr can be set to an absolute path OR apath
    relative to Server.RootDirectory
    <Server EnabledForDomainLog="true" ListenAddress="localhost"
    ListenPort="7701" Name="managed"
    StdoutDebugEnabled="true" ThreadPoolSize="15">
    <Log FileCount="10" FileMinSize="50" FileName="managed.log"
    Name="managed" NumberOfFilesLimited="true"
    RotationType="bySize"/>
    </Server>
    2. How do I tell WLS 6 to place tmp_ejb directories in a diff
    directory
    >>>
    Thanks,
    Scott

  • Problem with File Handler and log files

    I'm developing a polymorphic structure for file handling specially for the log file for a server based App... Its working fine except for one thing. The log file that goes into the File Handler comes as a parameter to the class, the problem is that when it writes de file, though it DOES know where it should go, it doesn't do it and it writes the message into some other Log file belonging to another process...
    Does someone know how to avoid this or fix it?? any ideas or tips would be great!!

    Immediately below the Tabs saying "Files" and Assets" is a small box 
    with arrow on the right to show the drop down list.        In the box 
    on the right there's an icon of two networked computers.  Then it 
    says, "ftp://Hill farm Web Site"  which is the name of my website.     
    If I click on the arrows to pull up the drop-down box,  I get four 
    options divided by a line.   Above the line the options are Computer, 
    HD and ftp://Hill farm Web Site.  Below the line it says manage sites.
    Below this is list of files that make up my website in a directory 
    structure.   The header for the first column reads, "Local Files",  
    which appears to be untrue, because the top line in the directory 
    structure below reads,  "ftp://Hill farm Web Site".
    Does this help?
    regards
    David

  • Log file sync vs log file parallel write probably not bug 2669566

    This is a continuation of a previous thread about ‘log file sync’ and ‘log file parallel write’ events.
    Version : 9.2.0.8
    Platform : Solaris
    Application : Oracle Apps
    The number of commits per second ranges between 10 and 30.
    When querying statspack performance data the calculated average wait time on the event ‘log file sync’ is on average 10 times the wait time for the ‘log file parallel write’ event.
    Below just 2 samples where the ratio is even about 20.
    "snap_time"     " log file parallel write avg"     "log file sync avg"     "ratio
    11/05/2008 10:38:26      8,142     156,343     19.20
    11/05/2008 10:08:23     8,434     201,915     23.94
    So the wait time for a ‘log file sync’ is 10 times the wait time for a ‘log file parallel write’.
    First I thought that I was hitting bug 2669566.
    But then Jonathan Lewis is blog pointed me to Tanel Poder’s snapper tool.
    And I think that it proves that I am NOT hitting this bug.
    Below is a sample of the output for the log writer.
    -- End of snap 3
    HEAD,SID, SNAPSHOT START ,SECONDS,TYPE,STATISTIC , DELTA, DELTA/SEC, HDELTA, HDELTA/SEC
    DATA, 4, 20081105 10:35:41, 30, STAT, messages sent , 1712, 57, 1.71k, 57.07
    DATA, 4, 20081105 10:35:41, 30, STAT, messages received , 866, 29, 866, 28.87
    DATA, 4, 20081105 10:35:41, 30, STAT, background timeouts , 10, 0, 10, .33
    DATA, 4, 20081105 10:35:41, 30, STAT, redo wastage , 212820, 7094, 212.82k, 7.09k
    DATA, 4, 20081105 10:35:41, 30, STAT, redo writer latching time , 2, 0, 2, .07
    DATA, 4, 20081105 10:35:41, 30, STAT, redo writes , 867, 29, 867, 28.9
    DATA, 4, 20081105 10:35:41, 30, STAT, redo blocks written , 33805, 1127, 33.81k, 1.13k
    DATA, 4, 20081105 10:35:41, 30, STAT, redo write time , 652, 22, 652, 21.73
    DATA, 4, 20081105 10:35:41, 30, WAIT, rdbms ipc message ,23431084, 781036, 23.43s, 781.04ms
    DATA, 4, 20081105 10:35:41, 30, WAIT, log file parallel write , 6312957, 210432, 6.31s, 210.43ms
    DATA, 4, 20081105 10:35:41, 30, WAIT, LGWR wait for redo copy , 18749, 625, 18.75ms, 624.97us
    When adding the DELTA/SEC (which is in micro seconds) for the wait events it always roughly adds up to a million micro seconds.
    In the example above 781036 + 210432 = 991468 micro seconds.
    This is the case for all the snaps taken by snapper.
    So I think that the wait time for the ‘log file parallel write time’ must be more or less correct.
    So I still have the question “Why is the ‘log file sync’ about 10 times the time of the ‘log file parallel write’?”
    Any clues?

    Yes that is true!
    But that is the way I calculate the average wait time = total wait time / total waits
    So the average wait time for the event 'log file sync' per wait should be near the wait time for the 'llog file parallel write' event.
    I use the query below:
    select snap_id
    , snap_time
    , event
    , time_waited_micro
    , (time_waited_micro - p_time_waited_micro)/((snap_time - p_snap_time) * 24) corrected_wait_time_h
    , total_waits
    , (total_waits - p_total_waits)/((snap_time - p_snap_time) * 24) corrected_waits_h
    , trunc(((time_waited_micro - p_time_waited_micro)/((snap_time - p_snap_time) * 24))/((total_waits - p_total_waits)/((snap_time - p_snap_time) * 24))) average
    from (
    select sn.snap_id, sn.snap_time, se.event, se.time_waited_micro, se.total_waits,
    lag(sn.snap_id) over (partition by se.event order by sn.snap_id) p_snap_id,
    lag(sn.snap_time) over (partition by se.event order by sn.snap_time) p_snap_time,
    lag(se.time_waited_micro) over (partition by se.event order by sn.snap_id) p_time_waited_micro,
    lag(se.total_waits) over (partition by se.event order by sn.snap_id) p_total_waits,
    row_number() over (partition by event order by sn.snap_id) r
    from perfstat.stats$system_event se, perfstat.stats$snapshot sn
    where se.SNAP_ID = sn.SNAP_ID
    and se.EVENT = 'log file sync'
    order by snap_id, event
    where time_waited_micro - p_time_waited_micro > 0
    order by snap_id desc;

  • SIU - Apply Computer Name and Local Hostname settings from a file

    I am setting up a workflow to image corporate computers and wanting to know how the "Apply Computer Name and Local Hostname settings from a file" works in the Apply System Configuration Settings task.
    We bind the computer to AD and OD and we have a specific naming convention for certain departments and trying to automate the entire imaging process.
    Would this be something that can be done with SIU?

    Well, maybe there's a bug in the latest version (10.5.3) of SIU as this is not what is happening.
    It doesn't seem to matter what I specify for the name parameters I end up with a Bonjour name of ".local".
    I put in a line of the form <Mac Address><TAB>tom<TAB>dick<TAB>harry into the text file used by the Apply System Configuration Settings Action.
    and end up with hostname = tom, Computer Name = dick and Bonjour Name = .local
    I'm building the NetInstall image on a new iMac running 10.5.3 booted out of a second partition and create the image from the main boot partition (also 10.5.3). I then copy the image to my server (10.5.3) and make a second iMac boot up from the NetInstall image.
    For what it is worth the Workflow Actions I am using are:
    Define Image Source
    + NetInstall
    Source: Macintosh HD
    Filter Clients by MAC Address
    + Allow
    <List of MAC Addresses>
    Enable Automated Installation
    + On Volume Named: Macintosh HD
    + Erase before installing
    + Primary Language: English
    Apply System Configuration Settings
    + Apply Computer Name and Local Hostname settings from a file: <FILE>
    Add Packages and Post-Install Scripts
    + Shell Script [Doesn't work - we're discussing in it in another thread]
    Create Image
    In: Public
    Named: NetInstall Classroom
    Volume Name: Classroom iMacs
    Index: 1

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

  • Information about file Id, Logical file name and Physical file name

    Hi All,
    I am testing one program. Selection screen has 3 parameters, File Id, Logical File Name and Physical file name. In Physical File name, i am giving complete file name with path. But it is giving error. Please tell me, what is File id and what all information i need to enter for logical file name and physical file name.
    Thanks
    Puneet Aggarwal

    hi,
    try using this for filename.
    parameters : p_file like rlgrap-filename.
    Thanks,
    Gaurav

  • Logical file names and Physical file names

    Hi Guys...
         Can you let me know what is the difference between Logical file names and Physical file names?
    Regards,
    Rohit

    Using Logical Files in ABAP Programs http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm
    Creating and Defining Logical Filenames
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3df8358411d1829f0000e829fbfe/content.htm

  • Process Flow ignores name and location for Control- and Log-Files

    Hi!
    Our OWB Version is 10.1.0.3.0 - DB Version 9.2.0.7.0 - OWF Version 2.6.2
    Clients and server are running on Windows. Database contains target schemas as well as OWB Design and Runtime, plus OWF repositories. The source files to load reside on the same server as the database.
    I have for example a SQL*Loader Mapping MAP_TEXT which loads one flat file "text.dat" into a table stg_text.
    The mapping MAP_TEXT is well configured and runs perfect. i.e. Control file "text.ctl" is generated to location LOC_CTL, flat file "text.dat" read from another location LOC_DATA, bad file "text.bad" is written to LOC_BAD and the log file "text.log" is placed into LOC_LOG. All locations are registered in runtime repository.
    When I integrate this mapping into a WorkFlow Process PF_TEXT, then only LOC_DATA and LOC_BAD are used. After deploying PF_TEXT, I execute it and found out, that Control and Log file are placed into the directory <OWB_HOME>\owb\temp and got generic names <Mapping Name>.ctl and <Mapping Name>.log (in this case MAP_TEXT.ctl and MAP_TEXT.log).
    How can I influence OWB to execute the Process Flow using the locations configured for the mapping placed inside?
    Has anyone any helpfull idea?
    Thx,
    Johann.

    I didn't expect to be the only one to encounter this misbehaviour of OWB.
    Meanwhile I found out what the problem is and had to recognize that it is like it is!
    There is no solution for it till Paris Release.
    Bug Nr. 3099551 at Oracle MetaLink adresses this issue.
    Regards,
    Johann Lodina.

  • Want to create unix shell script for  Clone procedure in 11i and r12

    Want to create unix shell script for Clone procedure in 11i and r12 .Can anyone help me on this as I m new to oracle apps and scripting.
    Thanks in advance .

    user11958935 wrote:
    Thanks but I want it for application cloning ie adcfgclone and autoconfig etc .Please see old threads for similar topic/discussion.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+Rapid+AND+Clone&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+AutoConfig&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • BACKGROUND JOB WAS NOT SCHEDULED/LOG FILE NOT YET GENERATED

    Hello,
    To generate the log report, /VIRSA/ZVFATBAK program is scheduled on hourly basis but some time report doesn't get generated and if we see the background job then it shows sucessfully finished.
    If we see the maually the log report for FFID then below error message is displayed.
    " BACKGROUND JOB WAS NOT SCHEDULED/LOG FILE NOT YET GENERATED"
    Can anyone guide me to solve the issue.
    Thanks in advance.
    Best Regards,
    Prashant Dubey

    Hi,
    once chk the status of the job by selecting that and check job status(cltr+shift_f12)
    since it was periodically scheduled job there will be a RELEASED job after every active job..
    so try to copy that into another job using copy option and give some new name which u have to remember...
    the moment u copy u can find the same copied job in SCHEDULED status...
    from here, try to run it again on hourly basis....
    After copying the job u can unschedule the old released job to scheduled otherwise 2 will run at a time...
    rgds,

  • How can I download music files (MP3) and video files (AVI) to iPod Nano?

    I just want to download music files (MP3) and video files (AVI) to my son's iPod Nano and iTunes has all menus grayed out, can't get on Apple support site to upload diagnostics file. Driving me mad - should be simple...  Please help!!! Dump of diagnostics below:
    Microsoft Windows XP Professional Service Pack 3 (Build 2600)
    INTEL_ DG41RQ__
    iTunes 11.1.3.8
    QuickTime 7.2
    FairPlay 2.5.16
    Apple Application Support 2.3.6
    iPod Updater Library 11.1f5
    CD Driver 2.2.3.0
    CD Driver DLL 2.1.3.1
    Apple Mobile Device 7.0.0.117
    Apple Mobile Device Driver 1.64.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number 0012B9B00CB27BC0
    Current user is an administrator.
    The current local date and time is 2013-12-22 23:15:54.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is disabled.
    HDCP is not supported.
    Core Media is not supported. (16002)
    Video Display Information
    ATI RADEON XPRESS 200 Series
    Intel(R) G41 Express Chipset
    **** External Plug-ins Information ****
    No external plug-ins installed.
    **** Network Connectivity Tests ****
    Network Adapter Information
    Adapter Name:        {E4F794BB-151F-490C-8AC0-1EDB6DA3718A}
    Description:             D-Link DWA-125 Wireless N 150 USB Adapter(rev.A2) - Packet Scheduler Miniport
    IP Address:              192.168.5.104
    Subnet Mask:          255.255.255.0
    Default Gateway:     192.168.5.1
    DHCP Enabled:       Yes
    DHCP Server:          192.168.5.1
    Lease Obtained:      Sun Dec 22 21:35:11 2013
    Lease Expires:         Mon Dec 23 21:35:11 2013
    DNS Servers:          91.216.105.75
                                    216.93.191.228
    Active Connection:  LAN Connection
    Connected:              Yes
    Online:                     Yes
    Using Modem:         No
    Using LAN:              Yes
    Using Proxy:            No
    Firewall Information
    Windows Firewall is on.
    iTunes is enabled in Windows Firewall.
    Connection attempt to Apple web site was successful.
    Connection attempt to browsing iTunes Store was successful.
    Connection attempt to purchasing from iTunes Store was successful.
    Connection attempt to iPhone activation server was successful.
    Connection attempt to firmware update server was unsuccessful.
    The network connection timed out.
    Connection attempt to Gracenote server was successful.
    iTunes has never successfully accessed the iTunes Store.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.3.0),
    D: LITE-ON DVDRW SHW-160P6S, Rev PRS2
    Drive is empty.
    **** Device Connectivity Tests ****
    iPodService 11.1.3.8 is currently running.
    iTunesHelper 11.1.3.8 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Standard Enhanced PCI to USB Host Controller
    Standard OpenHCD USB Host Controller
    Standard OpenHCD USB Host Controller
    Standard OpenHCD USB Host Controller
    Standard OpenHCD USB Host Controller
    Standard OpenHCD USB Host Controller
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C8.  Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C9.  Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CA.  Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CB.  Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB2 Enhanced Host Controller - 27CC.  Device is working properly.
    FireWire (IEEE 1394) Host Controllers:
    Texas Instruments OHCI Compliant IEEE 1394 Host Controller
    Connected Device Information:
    IPOD (K:\), iPod nano (7th Generation) running firmware version 1.0.2
    Serial Number:         DCYK27TGF0GT
    Bus Speed:              61440
    **** Device Sync Tests ****
    No iPod, iPhone, or iPad found.

    Hi fkerrin!
    In case you haven’t already tried this process before, here is an article for you about syncing media to the iPod:
    iTunes: Syncing media content to iPod
    http://support.apple.com/kb/ht1351
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • How to find output type givenSapscript form name and print program name

    Hi  Experts,
           Can anyone tell me how to find the output type of  a sapscript form if the print program name and sapscript form name is 
    known.

    Hi,
    There are two ways:
    1. Use table TNAPR .. Here is table give PGNAM as your print program name and FONAM as form name.. Now the field KSCHL will be the output type assigned to your script.
    2. You can also check the NACE t-code.. In that select a application(Corresponds to your area) -> click on Output types tab -> Here you get list of output type.. You need click on Processing Routine folder to get all other info..

  • Working Linux command to grep date range in a log file

    Linux Gurus,
    Could you please help me with command to show only those lines in a log file which falls under some date range, probably using grep command.
    Our server logs are in following format <Jun 23, 2013 12:45:02 AM UTC>
    Regards,
    Varun

    Perhaps you can do the following:
    Go to Google.
    Type "working Linux command to grep date range in a log file"
    See what results you might get from that search.  ( I did, and got more than 600,000 search results.)

  • How to design SQL server data file and log file growth

    how to design SQL DB data file and log file growth- SQL server 2012
    if my data file is having 10 GB sizze and log file is having 5 GB size
    what should be the size in MB (not in %) of autogrowth. based on what we have to determine the ideal size of file auto growth.

    It's very difficult to give a definitive answer on this. Best principal is to size your database correctly in advance so that you never have to autogrow, of course in reality that isn't always practical.
    The setting you use is really dictated by the expected growth in your files. Given that the size is relatively small why not set it to 1gb on the datafile(s) and 512mb on the log file? The important thing is to monitor it on an on-going basis to see if that's
    the appropriate amount.
    One thing you should do is enable instant file initialization by granting the service account Perform Volume Maintenance tasks in group policy. This will allow the data files to grow quickly when required, details here:
    https://technet.microsoft.com/en-us/library/ms175935%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396
    Also, it possible to query the default trace to find autogrowth events, if you wanted you could write an alert/sql job based on this 
    SELECT
    [DatabaseName],
    [FileName],
    [SPID],
    [Duration],
    [StartTime],
    [EndTime],
    CASE [EventClass]
    WHEN 92 THEN 'Data'
    WHEN 93 THEN 'Log' END
    FROM sys.fn_trace_gettable('c:\path\to\trace.trc', DEFAULT)
    WHERE
    EventClass IN (92,93)
    hope that helps

Maybe you are looking for

  • White screen , can't access recovery disk or usb

    hello guys, so I have an iMac 27" mid 2011 and yesterday I was watching something on youtube, and suddenly the screen was flickring and the screen went black. so I hold the power button to shut down the system. tried to restart it and a white screen

  • Problem writing metadata to Jpegs originating from Macs

    Everything works great when trying to write metadata to a JPEG that originates from a PC. But since my company runs a website, we have to be able to handle JPEGs that come from Macs. I've run across an issue where trying to write metadata to a Mac-JE

  • Air for ios optimization with bitmap break apart

    Hi, I'm developing an ios game with Flash CS5.5, and tries to optimize it as much as possible. I use bitmaps and GPU, but there is one thing I haven't found an answer to. I'd like to fill a background with bitmap tiles. An easy way (for me) to achiev

  • You need to restart your computer" (kernel panic) message appears

    I have this error, which ask me to restart my Imac every time I turn on... what to do now, its kernel panic... What is solution to it... please help!

  • IPhone 3G S: Audio Jack

    I'm not sure where I can post this yet but does anyone know if the audio jack in the new iPhone 3G S be able to directly connect to an audio in line (ie: in a car) without having to get some converter like the old ones?