Created
May 15, 2018 20:02
-
-
Save rubenbruno89/a18a762b78e69d0f13a30af8eeaf672c to your computer and use it in GitHub Desktop.
backup gui
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 | |
#Autor: Ruben Bruno Cavalcante de Menezes | |
#Em caso de bugs enviar um email para | |
#email: rubenbruno@outlook.com | |
while : [$? = 0] | |
do | |
DIR_ORIG=$(dialog --title "Backup" --inputbox "Informe o diretório de origem:" 10 35 --stdout) | |
DIR_DEST=$(dialog --title "Backup" --inputbox "Informe o diretório de destino:" 10 35 --stdout) | |
BKP_NAME=`date +%d-%m-%Y-%H.%M` | |
if sudo tar -czpf ${DIR_DEST}${BKP_NAME}.tar ${DIR_ORIG}; then | |
dialog --title "Backup realizado com Sucesso" --yesno "Deseja sair?" 0 0 && exit | |
else | |
dialog --title "Backup foi interrompido" --yesno "Deseja sair?"0 0 && exit | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment