Forum Discussion
Mic_108850
Altostratus
Apr 13, 2010"b" command in a crontab
Hi,
i'd like to set up a schedulded task on my BIG-IP LTM
The script should be run each day at the following hour:
09:10 and 11:10
The command included is to clear the RAMCACHE profile below:
b pro...
hoolio
Cirrostratus
Apr 14, 2010You could add logging to the script to see what it's doing. Replace the existing script with this named /root/ramcache.clear.bash
Save the output file name as the script name
OUT=/var/log/`basename $0`.out
Print the date and script name
echo "`date +%Y%m%d_%H%M%S`: `basename $0`: starting" >> $OUT
List the current RAM cache entries for one HTTP profile
echo "Entries before delete:" >> $OUT
b profile http MY_HTTP_PROFILE ramcache entry show >> $OUT
Delete current RAM cache entries for one HTTP profile
b profile http MY_HTTP_PROFILE ramcache entry all delete
List the current RAM cache entries for one HTTP profile
echo "Entries after delete:" >> $OUT
b profile http MY_HTTP_PROFILE ramcache entry show >> $OUT
And then remove the existing crontab entry and add this:
At 9:10 and 11:10, run the ramcache clear script on the active unit
10 9,11 * * * if [ `/bin/ps1` == "Active" ]; then /root/ramcache.clear.bash > /var/log/ramcache.clear.bash.out 2>&1; fi
The output will be logged to /var/log/ramcache.clear.bash.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
