I am writing an applescript to synchronise two folders, one local and one on a network. Each folder should have the same data, one is local (on a MacBook Pro) and the other on a windows network.
I have this script which works, but does not identify the most recent file:
property local_foldername : "~home/Documents" property destination_foldername : "smb://some/ networked/location" property eject_when_done : true property confirm_backup : true on clicked theObject tell application "Finder" if not (exists folder "Backups" of home) then make new folder at home with properties {name:"Backups"} end if set source_folder to folder local_foldername of home set the alias_list to every alias file of the source_folder if (count alias_list) > 0 then try duplicate every file of local_foldername to destination_foldername with replacing duplicate every file of destination_foldername to local_foldername with replacing end try end if end tell end clicked
If I run this only from the mac, any work done on a PC desktop which writes to the destination_foldername will be overwritten by files from the local_foldername. Unlike my backup scripts which only have changes to the original file, these files will be changed in both locations. I need to identify and replace only files that are older than the source files. Is this possible?
|