打开控制台(终端)窗口并在 os x 上执行命令(rsync)
我来自 Windows 背景,试图帮助一位 Mac 用户朋友将她的图片、文档等备份到外部驱动器上。在 Windows 中,我将通过使用 xcopy 命令创建一个简单的批处理文件来完成此操作,并在桌面上有一个双击时指向该 .bat 文件的快捷方式。然而,在 Mac 世界中,我在寻找如何做到这一点时遇到了很大的困难。我反复搜索以找到 mac 的等效项,但我找到的只是一些网站,上面写着“mac 上有很多选项 - 使用其中之一”之类的内容。然而,没有人给出具体的解决方案,也没有指出具体的解决方案。这里有人知道完成此任务的具体逐步过程吗?我只是想让她双击桌面上的图标并将其个人文档(不是应用程序设置或其他开销)复制到她的外部硬盘驱动器。任何帮助将不胜感激。
I am from a windows background and trying to help a mac user friend to backup her pictures, docs, etc. onto an external drive. In windows, I would accomplish this by creating a simple batch file with an xcopy command and have a shortcut on the desktop that pointed to that .bat file when double clicked. However, in the mac world I am having significant trouble finding how to do this. I have searched repeatedly to find the mac equivalent, but all I find are sites saying things like "there are so many options on a mac - use one of them." However, none have ever given a specific solution nor pointed to a specific solution. Anyone here know of a specific step by step process to accomplish this? I simply want to be able to have her double click an icon on the desktop and have it copy her personal documents (not application settings or other overhead) to her external hard drive. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
然而,我在类似情况下所做的并且我建议您做的是,我创建了一个 shell 脚本,而不是使用终端,而是从 AppleScript 应用程序启动它。当然,您也可以将整个 shell 脚本嵌入到 AppleScript 中。基本上它看起来像下面这样:
对要复制的每个文件夹重复 do shell ... 行,或者调用 shell 脚本本身。然后使用 Mac OS X 附带的 AppleScript 编辑器并将其另存为实际应用程序。
However, what I've done in similar situations and that I would recommend that you do is that I've created a shell script and instead of using Terminal I've initiated it from an AppleScript application. You can of course embed the entire shell script in the AppleScript as well. Basically it will look something like the following:
Repeat the do shell ... line for each folder that you want to copy, or call the shell script itself. Then use AppleScript Editor which is included with Mac OS X and save it as an actual application.