#!/bin/sh
mount -t cifs //192.168.5.90/share -o password='' /mnt/tera_nas
rsync -av --super --delete --recursive /home/ /mnt/tera_nas/home/
# sleep 5m (i want to avoid using this)
# Bash shell snippet to check if mounted Samba share is not busy before issuing umount command
umount /mnt/tera_nas/
|
| |||||
feedback
|
|
I would just lazy unmount it, using the -l flag. This will remove the mount point from the filesystem (so no new operations can start), and will finish the proper unmount once it is no longer busy. | |||
feedback
|
|
you could lsof to see if it has any open file descriptors | |||
|
feedback
|
|
Let umount do the work for you:
You could shorten the sleep time, but I wouldn't eliminate it. It serves a different role here than in your question. | |||
|
feedback
|
|
you could use "fuser -m mountpoint" to see if anyone is accessing the path. | |||
|
feedback
|
|
| |||
|
feedback
|
|
Use
Then | |||
|
feedback
|