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

Click here to return to the 'Automated (really) backup of flash drives' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automated (really) backup of flash drives
Authored by: cnotarianni on Feb 27, '07 09:20:35AM
The original script is not really "automated"... yet.
My following modied script saved as application bundle into flash drive will be!
Now you can use it with multiple flash drives different only by their own name!
The script:
set WhereImRunningFrom to path to me
tell application "Finder"
set AppCreator to creator type of WhereImRunningFrom
set NameOfDisk to name of disk of WhereImRunningFrom

set thedate to (current date)
set theday to day of thedate
set themonth to month of thedate
set theyear to year of thedate

set thedate to theday & "-" & themonth & "-" & theyear as string

---- OPTIONAL whith short month date
set thedate to theday & "-" & shortMonth(themonth) of me & "-" & theyear as string
end tell

if AppCreator is not "ToyS" then
do shell script
"rsync -rt /Volumes/" & NameOfDisk & "/ ~/" & NameOfDisk & "-Backup-" & thedate
activate of me
display dialog NameOfDisk & " drive backed up"
activate of me
display dialog "This script don't run directly into ScriptEditor"
end if

to shortMonth(themonth)
set MonthList to {January, February, March, April, May, June, July, August, September, October, November, December}
set mm to 1
repeat until item mm of MonthList = themonth
copy mm + 1 to mm
end repeat
if mm<10 then copy "0" & mm to mm
return mm
end shortMonth

[ Reply to This | # ]