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


Click here to return to the 'Scripting for back up' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Scripting for back up
Authored by: drdarrow on Jan 01, '05 02:21:17PM
I am not an AppleScripter by any stretch, but I have figured out anough to write a script that does some useful backups when I emember to run the script (which at worst I do once a month). If someone can re-write this to automate the "set-up" that would be cool. Any usedful additions I have overlooked would be appreciated, too.

Set-up:
On another Hard Drive create the following folder,

Back-ups
...into which you place the following empty folders
Copy of AddressBook
Copy of Application Support
Copy of Favorites
Copy of iTunes
Copy of Mail
Copy of Preferences
Copy of Safari
These are used to prevent an error the first time you run it. After running the script, these will be full.

Then I run this script, which I have named Regular Back-up

tell application "Finder"
	copy folder "Macintosh HD:Users:david:Library:Application Support:AddressBook" to folder "Macintosh HD 2:Back-ups"
	delete folder "Macintosh HD 2:Back-ups:Copy of AddressBook"
	set name of folder "Macintosh HD 2:Back-ups:AddressBook" to "Copy of AddressBook"
	
	copy folder "Macintosh HD:Users:david:Library:Mail" to folder "Macintosh HD 2:Back-ups"
	delete folder "Macintosh HD 2:Back-ups:Copy of Mail"
	set name of folder "Macintosh HD 2:Back-ups:Mail" to "Copy of Mail"
	
	copy folder "Macintosh HD:Users:david:Library:Preferences" to folder "Macintosh HD 2:Back-ups"
	delete folder "Macintosh HD 2:Back-ups:Copy of Preferences"
	set name of folder "Macintosh HD 2:Back-ups:Preferences" to "Copy of Preferences"
	
	copy folder "Macintosh HD:Users:david:Library:Safari" to folder "Macintosh HD 2:Back-ups"
	delete folder "Macintosh HD 2:Back-ups:Copy of Safari"
	set name of folder "Macintosh HD 2:Back-ups:Safari" to "Copy of Safari"
	
	copy folder "Macintosh HD:Users:david:Library:Application Support" to folder "Macintosh HD 2:Back-ups"
	delete folder "Macintosh HD 2:Back-ups:Copy of Application Support"
	set name of folder "Macintosh HD 2:Back-ups:Application Support" to "Copy of Application Support"

	empty trash

end tell
Of course, if you use this script, change the names of the Hard drives to match your system, and change the user name david to the user name that is correct for your use.

[ Reply to This | # ]