Forum Discussion
swo0sh_gt_13163
Altostratus
Hello Folks,
It seems I need the same solution but for version 11.2.1, where I need to save the backup file locally to the F5, rather than the external server.
I have tried using following script, somehow the script doesn't seems to be working. I am pretty sure I am making mistake somewhere. Can you please help?
[root@F5] / cat > /etc/cron.daily/abc
!/bin/sh
00 9 * * * tmsh save /sys ucs /var/local/ucs/F5_INT_1.test.gov.uk.ucs
Ctrl+C 3. [root@F5] / chmod +x /etc/cron.daily/abc
Thanks, Darshan
mdicarlo_60024
Jan 22, 2014Nimbostratus
Below is a script that should work. If you typed the above text into your /etc/cron.daily/abc exactly as listed above, you mixed a cron command and a shell script (with the !/bin/sh part). The cron stuff is the scheduling info. The script is what gets run.
You could try running "crontab -l" to verify what is listed.
Our crontab looks like this and captures output in the event of any problems or errors. Use "crontab -e" and add a simliar line to your crontab.
30 00 * * * /path/to/script/config_save.bash >> /path/to/scriptlog/config_save.log 2>&1
Then create your backup script - something like this.
SCRIPT for config_save.bash IS BELOW
Set variables for UCS file name
dt=`date +%Y%m%d`
hostname=`uname -n |cut -d. -f1`
Delete old ucs file created by this script
rm /var/tmp/$hostname*.ucs
Send syslog message to log servers
logger -p local0.info -t BIGIP configuration backup started.
Commit configuration from memory to files
cd /config
tmsh save /sys config
Create configuraiton archive
tmsh save /sys ucs /var/tmp/$hostname-$dt.ucs
Send syslog message to log servers
logger -p local0.info -t BIGIP configuration backup completed.
If you want to only run one command via cron, you would use "crontab -e" and add your line into it.
00 9 * * * tmsh save /sys ucs /var/local/ucs/F5_INT_1.test.gov.uk.ucs