Last active
July 7, 2020 16:45
-
-
Save kimonostereo/9900273c635a715fc731c3ddded59a34 to your computer and use it in GitHub Desktop.
Applescript for Panic's Transmit to sync a remote directory to a local directory with the option set to delete orphaned items. Modified from original script found here: http://www.mindthegapp.com/?p=4193
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Transmit" | |
with timeout of (240 * 60) seconds | |
activate | |
tell application "Transmit" | |
-- Prevent interactive alerts from popping up during script execution | |
set SuppressAppleScriptAlerts to true | |
-- Set some variables to values to be used later in the script | |
set myFTPServer to item 1 of (favorites whose name is "YourFavoriteHere") | |
set pathToMainBackupDirectory to "/Volumes/Backups/Daily Backups/Tuesday" | |
set listOfSites to {""} | |
-- Start working with Transmit | |
-- Loop through the list of sites, change the remote and local browser path and sync | |
-- the remote site to the local site | |
repeat with a from 1 to length of listOfSites | |
set theCurrentSiteListItem to item a of listOfSites | |
tell current tab of (make new document at end) | |
-- Connect to the FTP Server | |
connect to myFTPServer | |
-- Change the path for the remote browser to correct path on the FTP server | |
change location of remote browser to path theCurrentSiteListItem | |
-- Change the path for the local browser to location of the backup | |
change location of local browser to path "/Volumes/Backups/Daily Backups/Tuesday" & theCurrentSiteListItem as string | |
-- Tell Transmit 5 to sychronize the remote location to the local location and delete orphans and follow symlinks | |
synchronize remote browser to local browser with delete orphaned items and follow symlinks | |
-- Close the remote browser window | |
close remote browser | |
end tell | |
end repeat | |
set SuppressAppleScriptAlerts to false | |
end tell | |
end timeout | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment