rsync shell script

Joined
Feb 16, 2007
Messages
1
Reaction score
0
Hi all,

I am interested in writing a shell script which will mount a network drive, rsync a local drive to the now attached network drive and then unmount the drive. I have a readynas600 attached to my home network. The readynas supports may different file network protocols including afp and smb.

Thanks in advance for your assistance

Vince
 
Joined
Nov 17, 2011
Messages
3
Reaction score
0
I'm not quite sure about the easiest way of mounting remote file systems via shell.

you could use the open command "open smb://remote.host/remoteshare"
mounts under /Volume/remoteshare

or you could use the mount_smbfs command "mkdir /tmp/remote ; mount_smbfs //user:p[email protected]/remote/share /tmp/remote"
mounts under /tmp/remote

Once the device is mounted you can use the following rsync command;

rsync -a /local/path /Volumes/remoteshare

if you have used mount_smbfs you can use umount to unmount the filesystem "umount /tmp/remoteshare"

if you used open, then you need to use disktool to unmount. "disktool -e /Volumes/remoteshare"

hope this helps (some 4 years later!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top