Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- backup_dir="~/fullbkp_sysadmin"
- backup_server="192.168.0.3"
- directories=("/boot" "/etc" "/opt")
- # Crear directorio de backup de este host en el servidor remoto
- ssh educacionit@${backup_server} "mkdir -vp ${backup_dir}"
- # backup antes de modificar directorios y archivos (previo)
- for item in "${directories[@]}"; do
- echo "
- Realizando backup de $item
- "
- rsync -av $item educacionit@${backup_server}:${backup_dir}/previo
- done
- # Actualizacion del sistema segura
- apt update && apt upgrade -y
- # backup despues de modificar directorios y archivos (nuevo)
- for item in "${directories[@]}"; do
- echo "
- Realizando backup de $item
- "
- rsync -av $item educacionit@${backup_server}:${backup_dir}/nuevo
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement