Ubuntu 8.04 - I wrote a very simplistic script to backup the /home directory to a USB flash drive. I then scheduled it with gnome-schedule (run as root - gksu gnome-schedule). The script works OK and copies files as expected. It also writes the log and error files as directed. However, it opens a terminal window when it starts and displays the following message in the window when complete "Press ENTER to continue and close this window."
Here is the script:
Quote:
#!/bin/bash
echo >> /home/backup.log
echo ------------------------------------------------ >> /home/backup.log
date >> /home/backup.log
echo >> /home/backup.err
echo ------------------------------------------------ >> /home/backup.err
date >> /home/backup.err
cp -u -v -f -r /home /media/BACKUP >> /home/backup.log 2>> /home/backup.err
echo >> /home/backup.log
echo >> /home/backup.err
|
I have tried adding "exit" and "return" to the end of the script with no result. If I change the scheduled job to 'exec /home/backup.sh" it will run and the window will close automatically.
I am just wondering how to close the window programatically from within the script (if such a thing is possible).
Thanks,
Ken
p.s. If the USB drive is not present it does not write any errors and the log file appears to show that it copied every file. Still have to work on this phenomenon.