Paul Derby
Registered
I've been using a Unix script to back up my internal PowerBook drive to an external FireWire drive. The script runs just fine, but when the backup is completed, I drag the desktop image of the FireWire drive to the trash to unmount it and get a finder alert saying "The operation could not be completed because the disk "backup disk" is in use.
Any ideas what the problem is? I don't have any applications running that I know of that use the backup disk. I quit the terminal window when I finish doing the backup. Here is the script:
#!/bin/sh -
###
# Backup script for Mac OS X
#
# Example ./backup_sh '/Volumes/VA Backup Disk/FULL_BACKUP_FOR_X'
#
# History:
# -------------------------------------------------------------------
# 06/2001 Authored by Bernhard Baehr
# xx.xx.2001 bb created for Mac OS X Public Beta
# 25.03.2001 bb modified for Mac OS X final
# 22.06.2001 bb modified to use ditto
# 01.07.2001 bb added handling of the Mac OS X symbolic links in /
# and of /dev
# -------------------------------------------------------------------
# 08/02/2001 Modified by Barry Sharp
# 1. Add NAME variable
# 2. Cleanup and make tidy
# 3. Use full pathnames for programs
# -------------------------------------------------------------------
###
NAME="${0##*/}" # Obtain base of the calling pathname
if [ "$1" = "" ]; then
echo "Usage: $NAME target_directory"
echo " Backup up an HFS+ root file system to the target_directory"
echo " preserving Mac resource forks and Unix access rights."
exit 1
fi
if [ $(id -u) -ne 0 ]; then
echo "$NAME: you must be root to use this command"
exit 1
fi
echo "dumping to directory $1"
/bin/ls -1a / | while read i
do
case "$i" in
\.|\.\.|Volumes)
;;
var|tmp|etc|cores)
/bin/ln -s "private/$i" "$1/$i"
;;
mach)
/bin/ln -s "/mach.sym" "$1/$i"
;;
dev)
/bin/cp -Rp /dev "$1/$i"
;;
*)
/usr/bin/ditto -V -rsrcFork "/$i" "$1/$i"
# find "/$i" -type d -exec mkdir "$1{}" \; \
# -or -type f -exec CpMac "{}" "$1{}" \;
# cp -Rp "/$i" "$1"
;;
esac
done
exit 0
Any ideas what the problem is? I don't have any applications running that I know of that use the backup disk. I quit the terminal window when I finish doing the backup. Here is the script:
#!/bin/sh -
###
# Backup script for Mac OS X
#
# Example ./backup_sh '/Volumes/VA Backup Disk/FULL_BACKUP_FOR_X'
#
# History:
# -------------------------------------------------------------------
# 06/2001 Authored by Bernhard Baehr
# xx.xx.2001 bb created for Mac OS X Public Beta
# 25.03.2001 bb modified for Mac OS X final
# 22.06.2001 bb modified to use ditto
# 01.07.2001 bb added handling of the Mac OS X symbolic links in /
# and of /dev
# -------------------------------------------------------------------
# 08/02/2001 Modified by Barry Sharp
# 1. Add NAME variable
# 2. Cleanup and make tidy
# 3. Use full pathnames for programs
# -------------------------------------------------------------------
###
NAME="${0##*/}" # Obtain base of the calling pathname
if [ "$1" = "" ]; then
echo "Usage: $NAME target_directory"
echo " Backup up an HFS+ root file system to the target_directory"
echo " preserving Mac resource forks and Unix access rights."
exit 1
fi
if [ $(id -u) -ne 0 ]; then
echo "$NAME: you must be root to use this command"
exit 1
fi
echo "dumping to directory $1"
/bin/ls -1a / | while read i
do
case "$i" in
\.|\.\.|Volumes)
;;
var|tmp|etc|cores)
/bin/ln -s "private/$i" "$1/$i"
;;
mach)
/bin/ln -s "/mach.sym" "$1/$i"
;;
dev)
/bin/cp -Rp /dev "$1/$i"
;;
*)
/usr/bin/ditto -V -rsrcFork "/$i" "$1/$i"
# find "/$i" -type d -exec mkdir "$1{}" \; \
# -or -type f -exec CpMac "{}" "$1{}" \;
# cp -Rp "/$i" "$1"
;;
esac
done
exit 0