6

I'm currently wanting to deploy a setup to around 300 Macs. I have all of it scripted and ready to deploy, excepting that I'm having trouble creating a working alias to a samba share from the command line. I tried creating an alias, and then copying it from one Mac to another, but it loses its status as an alias, and instead OSX opens it in TextEdit (the @ in ls -l is also missing). Even if this did work, from a hexdump, it also looks like the alias has machine-specific information that may not work on another Mac.

Say that I wanted to create an alias to 'smb://server/share' on the desktop from the command line, how would I do that?

The machines run Mac OS 10.6.

Thanks.

3
  • "I tried copying it from one Mac to another, but it loses its status as an alias" -- have you made sure tocopy extended attributes as well as OS X metadata (esp. resource forks)? You could try to zip it up and unzip it on the other machine to preserve those
    – Daniel Beck
    Jul 1, 2011 at 8:10
  • Yeah, it loses the attributes. If I try to keep the attributes when copying it says something to the effect of chflags: Unauthorized. Jul 1, 2011 at 8:32
  • I should mention, it says that even if I copy the file as the superuser. Jul 15, 2011 at 11:52

2 Answers 2

0

I think you want mount_smbfs.

Dropbox may also be worth examining.

4
  • 1
    I don't want to mount it, I want to create an alias to it. Jul 1, 2011 at 22:21
  • I don't think there is a documented way of doing that from the command-line. The best option I see is to use mount_smbfs combined with a symlink, but I don't know that I fully understand the outcome you want. Jul 1, 2011 at 22:35
  • This questions was similar: superuser.com/questions/62587/… Jul 1, 2011 at 22:36
  • I don't want to mount and create a symlink, though, that's not suitable, because it would require manual remounting every single time (whereas the alias automounts it when initialised), which would defeat the entire point. Jul 1, 2011 at 22:38
0

When you are connected to the Samba share, do you have a folder for it in /Volumes? You could always Symlink to this folder.

Why don't you create an applescript or an shell script and put it on your desktop. The script would mount the share if necessary and enter it.

1
  • I tried this, but it does not work in the same way as a network alias. The alias can be used to mount the share and subsequently enter it. A symlink does not mount it, it simply complains that the path doesn't exist when it is not mounted. Jul 21, 2011 at 10:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .