AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  create crontab under AIX

    Posted Mon March 26, 2012 02:56 AM

    Originally posted by: SystemAdmin


    Hey guys,

    I would like to create an nmon-crontab on AIX and need help with the configuration.
    This is what I’ve done so far:

    TODAY=$(date +"%Y%m%d")
    usr/bin/nmon -F /home/informix/nmon/nmon_$TODAY.nmon -A -t -s79200 -c1439

    I would like the crontab to run once every day from 0.00h to 22.00h.

    Now, the question is, how to configure the crontab-file for the root user.
    Must the roo-user be logged on to run the crontab or just the cron-process ?
    Thank you for your help!

    Best regards,
    Stephan
    #AIX-Forum


  • 2.  Re: create crontab under AIX

    Posted Mon March 26, 2012 08:03 AM

    Originally posted by: SystemAdmin


    su - root

    and then submit it that's it :)

    Thanks,

    Dipak
    www.unix4you.com
    #AIX-Forum


  • 3.  Re: create crontab under AIX

    Posted Tue March 27, 2012 02:16 AM

    Originally posted by: SystemAdmin


    Hey,

    first of all, thanks for your reply!

    Finally I almost got the solution, but also have a little problem.
    This is what I added to the crontab file:

    0 0 * * * /usr/bin/nmon -F /home/informix/nmon_data/analysis_`date +%Y%m%d`.nmon -A -t -s30 -c1439
    Now I get the fallowing message from root@AIXHOST:
    Cron Environment:
    SHELL = /usr/bin/sh
    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java5/jre/bin:/usr/java5/bin
    CRONDIR=/var/spool/cron/crontabs
    ATDIR=/var/spool/cron/atjobs
    LOGNAME=root
    HOME=/root

    Your "cron" job executed on AIXHOST on Tue Mar 27 00:00:00 MES 2012 /usr/bin/nmon -F /home/informix/nmon_data/analysis_`date +%Y%m%d`.nmon -A -t -s30 -c1439

    produced the following output:

    ERROR nmon invalid option "Mar"

    Hint: topas_nmon -h -s <seconds> -c <count> -f -d -t -r <name> -x
    Command: TOPAS_NMON
    -h FULL help information - much more than here
    Interactive-Mode:
    read startup banner and type: "h" once it is running
    For Data-Collect-Mode (-f)
    -f spreadsheet output format note: default -s300 -c288
    optional
    -s <seconds> between refreshing the screen default 2
    -c <number> of refreshes default millions
    -t spreadsheet includes top processes
    -x capacity planning (15 min for 1 day = -fdt -s 900 -c 96)

    *****************************************************************
    cron: The previous message is the standard output
    and standard error of one of the cron commands.
    Something went wrong with the concatenation of the formatted date and the other stuff.

    Can you help me out with this ?

    Thank you !

    Best regards
    #AIX-Forum


  • 4.  Re: create crontab under AIX

    Posted Wed March 28, 2012 02:11 AM

    Originally posted by: SystemAdmin


    Hey guys

    Finally I got the solution:

    The Crontab itself works like this:

    +0 0 * * 2 /usr/bin/nmon -F /home/informix/nmon_data/analysis_`date "\%Y\%m\%d"`.nmon -A -t -s30 -c1439
    I hope this helps out, if somebody has similar problems.

    It’s also important to know that after some time you have to kill your nmon process manually ;)

    Best regards
    #AIX-Forum