Last active
January 16, 2019 18:56
-
-
Save parzibyte/5bc323db5a02431c097e5815aa93e939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RUTA_SCRIPT=`dirname ${BASH_SOURCE[0]}` | |
FECHA_Y_HORA=`date "+%d-%m-%y_%H-%M-%S"` | |
NOMBRE_ARCHIVO="respaldo_$FECHA_Y_HORA.tgz" | |
CARPETA_DESTINO="$RUTA_SCRIPT/respaldos" | |
# Nota: la carpeta a respaldar puede ser otra, pero si no es relativa al script, pon su ruta completa | |
CARPETA_RESPALDAR="$RUTA_SCRIPT/cosas_importantes" | |
# Creamos el directorio para los respaldos por si no existe | |
mkdir -p "$CARPETA_DESTINO" | |
tar cfvz "$CARPETA_DESTINO/$NOMBRE_ARCHIVO" "$CARPETA_RESPALDAR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment