Forum Discussion
Variables in SSH CLI? Help automating backups
I'm looking for a better way to speed up backups. I have looked into some of the custom scripts and iApps, but all seem a little messy, so I just do them manually. Even if I can speed them up a little bit and come up with a one-size-fits-all command I can run that would work for now. I don't know anything about Bash, Cron, etc. just trying to do something simple that works.
Here is what I am doing on each of my devices:
tmsh save /sys ucs /var/local/ucs/HOSTNAME-DATE.ucs
scp -p /var/local/ucs/HOSTNAME-DATE.ucs USERNAME@FTPSERVER:/home/DIRECTORY/
Obviously I have to update the HOSTNAME and DATE manually each time. Can anyone help me with a way to automate this, where HOSTNAME and DATE are automatic, so I can just paste a simple set of commands into each device?
2 Replies
- JG
Cumulonimbus
scp -p /var/local/ucs/${HOSTNAME}_$(date +%G%m%d_%H%M) USERNAME@FTPSERVER:/home/DIRECTORY/ - jaikumar_f5
Noctilucent
Can help you with a simple bash script provided you have a jump server which can reach all your remote F5 servers.
If SSH keys have been exchanged(Passwordless login), the work is more simpler. If not we can go with a simple sshpass to through pwd.
Let me know if you have jump server and key exchanged.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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