This post is 10 years old. The screenshots have been removed.
I’d been manually backing up my website whenever I did changes and I use the synchronize feature in Transmit to do it. Transmit is a FTP client for the Mac by Panic Software. Transmit remembers settings between sessions so it was easy enough to do this if the only synchronize I ever did was the web backup. Or if I trusted myself to reset things correctly before each session. Since the whole point of synchronize is to only copy/delete the changes it’s important to keep things the same. Plus it’s only a matter of time before an errant or missed setting uploads instead of downloads or causes some other disaster. So I put on a pot of coffee and prepared to automate the process.
It was so trivial I was done before the coffee was brewed. You can adapt these procedure for pretty much any synchronization. The procedures are for backing up the files on my website down to my local Mac. The databases are not backed up, only files.
Create the Automator Script
1. Create a Favorite connection in transmit that connects to the top directory of the tree you want to back up. In my case it’s /public_html on my server so I back up my production and test websites which are are subdirectories under this directory.
2. Create a folder on your Mac to serve as a backup destination. I created WebBackups/websites under Documents. The ftp synchronize will put the files in the websites sub-folder. I created it as a sub-folder of WebBackups so I could also add other backups later such as database backups or safety backups before an upgrade. I’ll also but the automator script in WebBackups.
3. Open Automator, locate “Transmit” in the Library list, then select “Synchronize Files” in the Action list and drag it to the workflow window. Click the thumbnails to see full size.
4. In the “Connect To” drop down select “Favorite”. This will give you the following options:
5. Select the Favorite you created in step one as the “Favorite”.
6. Select Download as the “Sync Direction”.
7. Select Mirror as the “Sync Method”. This will make the directory on your Mac match the server each time it is run. This will delete files so be sure the source and destination are set correctly.
8. Select the directory you created in step 2 as the “Local Path”.
I don’t skip any files even though some will be hidden in Finder by default. I’ve found the automatic time offset works fine. The screen shot below shows my settings.
9. Save the Automator script (yes, just one action) as an application. From the menu select File -> Save As then select “Application” as the file format. Save the file as WebsiteBackup.app to the /WebBackups directory created in step 2 (not the Websites subdirectory).
Schedule the Backup
1. Open iCal.
2. This is optional but recommended. Create a new calendar called “System Tasks”. This will allow you to segregate your scheduled computer tasks from your appointments and todos. Select File -> New Calendar from the menu.
3. Create a new event. Select the time you want the backup to run and tell it to repeat every day. For the Alarm select “Open File” as the action. The alarm type will say iCal, change it to the the WebsiteBackup automator app you created up above. Do this by selecting “Other” and browsing for it. Set the alarm to 0 minutes before. The completed event is shown below.
You do need to be logged onto the Mac for this to run and the Mac cannot be in sleep mode when the event is scheduled to occur. Neither iCal or Transmit need to be running. Transmit will open, run the sync, then shut down. As I mentioned, some files will be hidden in Finder. These are the files that begin with a dot (.) such as .htaccess. These files will be viewable in Transmit and can be copied back if necessary.
The first sync will take some time although exactly how much depends on your website and link speed. Future syncs will be quicker since only changes are copied.
One the downside, there’s no logs and if the link is down at the appointed time the sync will fail silently. You should check the backup occasionally to make sure it’s working.