Forum Discussion

Sumit_Kumar_Dub's avatar
Icon for Nimbostratus rankNimbostratus
Jun 25, 2019

Steps to configure cron jobs to execute commands | F5 BIG IP LTM 13.X

Hi All,   I need help to configure cron job to run below two commands on hourly basis. Could you please help me with the steps:   tmsh run cli script certificatereports.tcl > /var/tmp/cert-output...
  • jaikumar_f5's avatar
    Jun 27, 2019

    Had this replied yesterday in the codeshare, nevertheless will add the same comment here - hoping it could help someone in future.


    Hi Sumit,


    Apologies on the late reply, Good to know that you already have smtp set.

    The next easy step is to put a small script with any mail agent (sendmail or mail or mailx) and have that script run on cron for every month.


    Goto /var/tmp/ and create a file as

    Add the below code inside the file.

    tmsh run cli script certificatereports.tcl > /var/tmp/cert-outputs.txt
    subject="Automated SSL Certificate Report"
    mail -s "$subject" -r "$from" -a "/var/tmp/cert-outputs.txt" "$to" << EOF
    Hi Team,
    Please find the attached SSL Certificate Report.
    Thanks & Regards,

    Change the permission to executable one.

    chmod +x

    Now goto your crontab & do a list first to see the existing cron jobs running.


    crontab -l

    You should see some couple of disk monitors check etc etc.


    Always put some good comments before you make an entry of your cronjob, Use crontab -e to edit/add your entries.

    crontab -e

    Goto the of the section and the below 2 lines,


    ## Section for Automated SSL Certificate Report - Monthly Cron - Start of month - 6 O'clk ##
    0 6 1 * * /usr/bin/bash /var/tmp/

    You can edit this cron value according to your need. For testing, try running this for every day 1 AM report - 0 1 * * *

    Hope this helps. Let us know if you have more concerns.