Apple Footer. This site contains user submitted content, comments and opinions and is for informational purposes only. Apple may provide or recommend responses as a possible solution based on the information provided; every potential issue may involve several factors not detailed in the conversations captured in an electronic forum and Apple can therefore provide no guarantee as to the efficacy of any proposed solutions on the community forums. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the.
Open Terminal, which is in the Utilities folder of your Applications folder. Type or paste one of the following commands in Terminal. These assume that the installer is still in your Applications folder, and MyVolume is the name of the USB flash drive or other volume you're using.
To keep multiple folders and thousands of files synchronised can be a real headache without a convenient method to automate the task. Consider this scenario: you have several folders on your Mac that must be kept fully synchronised with an external USB memory stick, hard drive, or simply with another computer or mobile phone. Copying files manually can be just too time consuming and it’s easy to miss a few files, so inevitably you end up with multiple versions in each location. On the Mac, it’s easy to synchronise any numbers of files and folders; the most common methods are:. With third-party apps from the App Store. With the built-in rsync Terminal utility.
With rsync in combination with Automator. METHOD 1: Third-Party Apps There are a dozen or so third-party apps available in Mac App Store that can simplify and automate the process of keeping files and folders synchronised.
Additionally, cloud-based services such as Dropbox can synchronise files on multiple machines very simply (note that the Mac version of Dropbox is only available from their website, not in the App Store). For most people a third-party app is the most convenient and hassle-free method to sync your data, with the advantage that lots of features are provided such as the ability to sync files, music, pictures, bookmarks and other data. Some of the most popular synchronisation apps are:. METHOD 2: rsync Utility Rsync is a very useful utility built into Mac OS X which allows the differences between two sets of files to be synchronised. Rsync can also sync data over a network, so if your folders are on another computer this method can be tweaked slightly to use the relevant remote hostname. To use rsync follow the steps below. Open Terminal from the Utilities folder or Spotlight 2.
In the Terminal window type rsync -aE –delete / / “” For example: rsync -aE –delete “/Documents/” “/Volumes/Macbook Pro Backup/” This example keeps everything in the Home Folder’s Documents directory synchronised with the external disk named MacBook Pro Backup and deletes anything in the destination folder which isn’t already in the source folder. This example creates a copy of Documents in the top level of the external disk’s folder structure. Note: rsync is a very powerful tool that has dozens of command-line options, so it’s worth reading the user manual in more depth (in Terminal, just type man rsync and press Enter). METHOD 3: rsync Utility + Automator While rsync certainly gets the job done, it’s much more useful when combined with Automator to simplify the whole process. This method is particularly effective when you have multiple folders in different locations that need to be synchronised, because you can enter any number of rsync commands into the script. Open Automator from the Applications folder or within Spotlight 2.
Choose Workflow when prompted, as below Create a new workflow in Automator 3. Search for the Run Shell Script action in the search field, then drag the icon into the main window on the right-hand side Find the Run Shell Script command in the Actions list 4. In the Run Shell Script dialogue, change the Pass input drop-down field to as arguments 5. Under Options at the bottom of the workflow, make sure the checkbox labelled Ignore this action’s input is checked.
The reason is that it’s just going to run as a standalone script and won’t take any files as input 6. In the Run Shell Script dialogue, delete any commands already included by default and replace them with the appropriate rsync commands.
Make sure you specify the correct source and destination folders Enter the appropriate rsync commands into the workflow 7. Choose Save from the File menu and save the workflow as an application, then hit the Save button Save your workflow as an application 8. Now just run the application you’ve created whenever you want to synchronise the selected folders Note that it’s possible to add your sync app to the Login Items (under System Preferences - User & Groups) to run every time you login, or to create a scheduled task to run the script on a regular basis. You might also like to copy the application into the startup items folder to run every time your computer starts. The startup folder on your Mac is at //Macintosh HD/Library/StartupItems but note that in the case of an external drive or USB stick it would need to be connected to run successfully.
Run your synchronisation app every time you login. It’s 2017 now and the Mac and Terminal have grown a little; when tested, Terminal didn’t like the quotation marks around the source and destination file paths. Removing them allowed it to run normally.
Also, as mentioned by someone else, the example command given under option 2, using the rsync utility would be better off displayed using a “code” tag: “rsync -aE –delete “/Documents/” “/Volumes/Macbook Pro Backup/”” before the “delete” argument that copied and displays as an en-dash and needless to say Terminal didn’t like that initially. Very helpful tip otherwise, thank you for making it so easy to follow and including the screenshots!