Advertisement
allan

R81.10 backup

May 20th, 2022
615
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. FWM_VER="R81.10"
  4. VER="r81.10t$(cpinfo -y MGMT|grep -Eo '[0-9]+$')"
  5. BASENAME="$(hostname)-${VER}-$(date +%Y%m%d)"
  6. cpstop
  7. echo "Exporting configuration to ${HOME}/backups/${BASENAME}.tgz ..."
  8. $MDS_FWDIR/scripts/migrate_server export -skip_upgrade_tools_check -v ${FWM_VER} -n "${HOME}/backups/${BASENAME}"
  9. cpstart
  10. cd ${HOME}/backups
  11. echo "Generating SHA512 hash to ${HOME}/backups/${BASENAME}.sha512 ..."
  12. sha512sum "${BASENAME}.tgz" > "${BASENAME}.sha512"
  13. echo "scp ${HOME}/backups/${BASENAME}.* admin@backup-server:backups"
  14. scp ${HOME}/backups/${BASENAME}.* admin@backup-server:backups
  15. exit
Advertisement
RAW Paste Data Copied
Advertisement