多年来,当我想在我的MAC上装载特定卷时,我一直在运行applescript程序以连接到服务器。
一旦登录到帐户,附件的附件便可以正常使用。
我正在使用Filemaker Pro的部分活动,现在想提高效率,我现在想使用在服务器上执行脚本(PSoS)。但是,由于我的所有数据都驻留在网络附加存储(NAS)上,因此需要将特定卷安装在后端。
我想知道是否可以使用随附的appelscript代码在后端安装所需的卷。如果可能,有人可以告诉我在哪里寻找文档吗?
--
-- AppleScript : MountFARAMIR
-- Version : 1.1
--
-- Coder: Daniel Paquin
-- Date: January 2019
--
-- Input Variables (parameters):
-- volumetobemounted
-- serveraddress
--
-- Output Variables
--
tell application "Finder"
set volumetobemounted to "Data"
set serveraddress to "smb://username:[email protected]/"
set mounted_disks to list disks -- Get list of mounted disk
if mounted_disks does not contain volumetobemounted then --Verify if volume Data has been mounted
try
mount volume serveraddress & volumetobemounted -- Mount volume at Server Address
on error errMSG number errorNumber
display dialog ("There was a problem mounting FARAMIR/DATA : " & errorNumber as text) & ", please notify your system administrator"
return
end try
end if
end tell
同时,我一直在通过在etc文件夹中添加auto_smb来尝试另一种解决方案。不幸的是,我无法使auto_master和auto_smb正常工作。
auto_master看起来像这样:
#
# Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
/- auto_smb -nosuid,noowners
#/- auto_afp -nobrowse,nosuid
auto_smb看起来像这样:
#
#
#
/mount/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:[email protected]:/Data
/mount/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://username:[email protected]:/Anonymous WebDav
auto_master和auto_smb文件的权限为:-rw-r--r--根轮
我已经使用命令'sudo sudo automount -cv'重新启动了auto_fs服务
以下是重新启动auto_fs服务的结果。
automount: /net updated
automount: /home updated
automount: /Mount/Data updated
automount: /Mount/Anonymous updated
automount: no unmounts
您可以在FileMaker Server管理控制台中添加脚本计划,以在设置的时间调用applescript。这可能是您安装NAS的脚本
https://fmhelp.filemaker.com/help/18/fms/en/index.html#page/FMS_Help/schedule-run-system-script.html
请注意,脚本本身只能位于一个位置:FMS脚本文件夹,如果不在该位置,则在设置计划时将无法选择它。
还要注意权限:脚本文件本身(所有者和组必须是fmserver / fmsadmin)上的脚本都将在该fmserver用户的上下文中执行。该用户需要适当的权限才能执行您想要的操作。