Forum Discussion
Mostafa_Ezzat_1
Mar 05, 2019Nimbostratus
automated Backup Scirpt
iam trying to taking automated backup and transfer it to a remote ftp server using running the script using the sh script.sh its runs perfectly fine and when trying to added the script in the crontab...
PeteWhite
Mar 05, 2019Employee
FTP is pretty tricky to get right in scripts - I have used expect before but it takes a lot of doing. Better to use iControl REST. Use my iCR Python module and use the script below:
!/usr/bin/env python
from iCR import iCR
bigip = iCR("172.24.9.132","admin","admin")
Create new UCS
data = { "command": "save", "name": "myTestUCS"}
ucs = bigip.create("sys/ucs",data)
Move UCS to /shared/images
data = { "command": "run", "utilCmdArgs": "-c 'mv /var/local/ucs/myTestUCS.ucs /shared/images'"}
mv = bigip.create("util/bash",data)
Download UCS
download = bigip.download("myTestUCS.ucs")
Delete UCS from /shared/images
data = { "command": "run", "utilCmdArgs": "-c 'rm /shared/images/myTestUCS.ucs'"}
rm = bigip.create("util/bash",data)
I'm sure you can see the parts which you need to change for your own environment.
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