You are not logged in.
Hello,
i'm trying to built a simple backup script which launches rsync and zenity:
#/bin/bash
rsync -auvh --progress --delete / /mnt/BACKUP | zenity --progress --auto-kill
What i want to archive is that if i press the "cancel" button of the zenity progress bar, the rsync process should be killed. What happens instead is that my bash is killed.
Is there any nice way of how i can kill the rsync process when i press the "cancel" button?
Thanks in advance,
Robert
Offline
check exit code?
#/bin/bash
rsync -auvh --progress --delete / /mnt/BACKUP | zenity --progress --auto-kill
if [ $? = 1 ]; then
echo you pressed cancel
killall rsync
else
echo you did not press cancel
fi
Offline