This is what I've got so far:
Storage Folder Backup
Defines mount point
Checks for mount
if mount | grep "on $LOCALMOUNTPOINT" > /dev/null; then
If already mounted initiates rsync job
caffeinate -i rsync -av /Users/auser/storage/ /Volumes/thisisanetworkshare/ --log-file=/Users/auser/rsync.log
Otherwise mounts and initiates rsync job
mount_smbfs //thisnetwork/thisisanetworkshare /Volumes/thisisanetworkshare
caffeinate -i rsync -av /Users/auser/storage/
So basically I want to start an rsync if the network share is already mounted but if it's not then I would like to mount that network share and start an rsync.
The network share requires auth but this is saved in the keychain so doesn't ask for it in finder. Does this matter for a shell script?
Thanks in advance!