Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript for real time backups with Path Finder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript for real time backups with Path Finder
Authored by: Synchro on Apr 11, '06 10:03:44AM

While it seems like a nice way of tagging things for backup, wouldn't it be a better idea to use something like rsync to do the actual copies? It should be much faster, and will also 'catch up' if the script happened to miss anything, and it will copy files that changed instead of just ones that have been added.



[ Reply to This | # ]
An AppleScript for real time backups with Path Finder
Authored by: zeusr on Apr 11, '06 06:38:13PM

You can use launchd in combination with rsync, and just have rsync copy whenever something is changed in that folder. I use Lingon and RsyncX as the GUIs (when I don't want to remember the command line stuff).



[ Reply to This | # ]
An AppleScript for real time backups with Path Finder
Authored by: e:leaf on Apr 12, '06 11:51:15PM

I have found a way to do it via rsync (after a bit of time in the man pages of course).

Here we go . . .


on adding folder items to this_folder after receiving added_items
	try
		tell application "Path Finder"
			if exists "/Volumes/path/to/backup/volume" then
				do shell script "/usr/bin/rsync -a --delete --delete-after /path/to/source/directory/ /Volumes/path/to backup/directory"
			end if
		end tell
	end try
end adding folder items to

Using rsync actually synchronizes the source and backup folder (the destination folder will look exactly like the source folder after the script runs) rathr than simply copying files from one folder to the next. You can also set up rsync to do a backup of any files which are deleted from the destination folder in the event that you want to replace an older version of your file by using the '--backup' and '--backup-dir=/path/to/backup/folder' verbs.

Now none of us have an excuse to not have regularly backed up files (atleast the important ones).



[ Reply to This | # ]