Forum Discussion
Automated ASM Backup - working bash script now to automate or convert to iCall/tcl
- Jun 19, 2019
For the basics see https://devcentral.f5.com/s/articles/what-is-icall-27404
Also check out the following as an iCall example https://devcentral.f5.com/s/articles/icall-crl-update-with-route-domains-and-auto-sync-1169 (shameless plug of my own code)
You can run shell commands from TCL using the exec command and also run tmsh commands (see TMSH scripting help at https://clouddocs.f5.com/api/tmsh/)
It is a lot to take in and learn over running Bash scripts (and using cron to schedule them) as the iCall scripts and configuration is part of the F5 configuration so backed up and retained during upgrades.
@saidshow not a problem, glad you managed to work it out.
It it always is the simple things missed that catch us out, took me a while and many many versions to get that iCall working correctly.
Also if you want to set my answer as the accepted answer will hopefully help other in the future.
Sorry it took me so long to come back and put some detail here.
- First up, I copied my bash script to the F5 platform.
- Next I created the iCall script that will execute the bash script.
- Finally I created the iCall period handler that will run every 4 weeks.
*From interactive tmsh shell on the F5:
create sys icall script asmBackupScript
Now in VIM, edit the script and save.
sys icall script hi {
app-service none
definition {
exec /asmBackup/asmBackup.sh
}
description none
events none
Creating the iCall Periodic Handler:
The one liner below needs to run from an interactive tmsh shell.
create sys icall handler periodic asmBackupHandler {interval 2419200 script asmBackupScript}
You can then edit this script further in vim by running:
edit sys icall handler periodic asmBackupHandler
eg: you can add a time for this script to run first time:
The setup below will see the script run every 4th Sunday at 10:00am
sys icall handler periodic asmBackupHandler {
first-occurrence 2019-07-07:10:00:00
interval 2419200
script asmBackupScript
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com