System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create cron script in HP-UX

 
Advisor

How to create cron script in HP-UX

Hi All,

As per management decision, we keep only one month audit log in HP-UX (version: 11.31) system.

So we  delete/move  log more than month. It need's to create cron script  in HP-UX 11.31.

 

Please assit to create cron scipt  for above purpose.

 

 

 

1 REPLY 1
Highlighted
HPE Pro

Re: How to create cron script in HP-UX

Hello Ashraf1,

 

Easy to remember crontab file format:

* * * * * command to be executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)

MIN     HOUR      DATE     MONTH     DAY     /PATH-TO-COMMAND

Method to trim the log files -

  1. Turn off auditing:

# audsys -f

  1. Backup the log files audfile1 and audfile2 to another filesystem, or archive them in case they are needed.
  2. Zero out the files:

 

# > audfile1

# > audfile2

  1. Restart the auditing subsystem to use the files and put limits on their size:


# audsys -n -c audfile1 -s 5000 -x audfile2 -z 2000

  1. Run the audsys command to verify that the auditing system is active again:

 

# audsys

you can put these steps into a script and put it into the cron

Hope this helps !

Accept or Kudo