I've checked out a few questions but none have helped so far.
I have an AppleScript backing up my RAW files from one HDD to another, and I'd like to include a NAS drive in that process. I'm using
do shell script "open 'smb://NASDrive/Matt RAW Backup/Backups'"
do shell script "rsync -a '/Users/Matt/Desktop/Test Folder/' '/Volumes/NASDrive/Matt RAW Backup/Backups' --delete"
error "ssh: Could not resolve hostname smb: nodename nor servname provided, or not known
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/io.c(453) [sender=2.6.9]" number 255
It's probably a timing issue.
I recommend to use the AppleScript
mount volume command and wait until the disk appears in
You need to replace
server.local with the server name of your NAS.
set diskName to "NASDrive" try mount volume "smb://server.local/" & diskName repeat until diskName is in (do shell script "ls /Volumes") delay 0.2 end repeat do shell script "rsync -a '/Users/Matt/Desktop/Test Folder/' '/Volumes/NASDrive/Matt RAW Backup/Backups' --delete" on error e display dialog "An error occurred: " & e end try