I have a basic bash script which I use to rsync one external drive to another external drive. I'm concerned that my script may delete everything from my destination drive if the source drive hasn't mounted properly.
How can I include a condition to check whether my external hard-drive is mounted?
Both drives mounted (mount command):
# List files to wake up drives
# Synchronize external hard drive to mirror hard drive
sudo rsync -av --progress --delete --exclude .Trash* /media/external/ /media/mirror/
Could I use awk to grab the third column and compare that to a string or something?
/dev/sdc1 on /media/external type vfat (rw,uid=1000,gid=100,utf8,dmask=027,fmask=137)
/dev/sdd1 on /media/mirror type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
I'm running 9.04 x86 server edition.