0

Hi All,
Have written a script file as follows:

mysqldump -u xxx -pxxx dbase1 > backup.sql
DATETIME=`date +%Y-%m-%d--%H-%M-%S`
mv backup.sql /home/user01/dumps/Backup_${DATETIME}.sql
read -p "Backup Complete.  Press a Enter to exit"

If I run the script by typing it's name at a terminal prompt it runs fine, but if I use the gui and then double-click the icon for the script it runs, but doesn't pause for the user to see the 'Complete' message. I have tried clicking 'Run in Terminal' and 'Run' but neither pauses. The rest of the script runs correctly, as the backup file is created and renamed to current date/time - it's just the last line of the script that I am having problems with. Basically I want to re-create the old DOS 'pause' command at the end of the script.

Running Ubuntu 12.04 LTS

toomutch

2
Contributors
1
Reply
12
Views
3 Years
Discussion Span
Last Post by rch1231
0

You could add

sleep X

as a fifth line where X s the number of seconds till it continues or use

echo "Backup Complete" | more -d

instead of the read -p to get it to prompt with

Backup Complete
[Press space to continue, 'q' to quit.]

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.