Hello all,
I'm new to using AppleScript so please forgive me if my code is rubbish
I have the following script which will let me backup to and from a USB to a users home dir, I have tried mobile accounts but the syncing has been giving me some issues. I have now decided to enable local managed accounts and to let users backup a complete copy of their home dir, my AppleScript lest me do this well but I have a slight issue.
I cannot seem to find a way to output the progress of the backup in AppleScript, the backup works fine but I need to show the users for feedback so the know when the backup is finished.
Here is the script:
tell application "Finder"
if not (exists disk "BACKUP") then
display dialog "No Backup Disk Detected"
quit
end if
if exists disk "BACKUP" then
set CurrentUser to do shell script "whomami"
set question to display dialog "What would you like to sync?" buttons {"From Mac","To Mac","Cancel"} default button 3
set answer to button of returned question
if answer is equal to "From Mac" then
try
do shell script "rsync -vaE --delete --update '/Users/"& CurrentUser &"/' '/Volumes/BACKUP/Sync/ '"
end try
else
if answer is equal to "To Mac" then
try
do shell script "rsync -vaE --delete --update '/Volumes/BACKUP/Sync/' '/Users/"& CurrentUser &"/'"
end try
end if
end if
end tell
Hope someone can help!!
Thanks in advance,
Si
I'm new to using AppleScript so please forgive me if my code is rubbish
I have the following script which will let me backup to and from a USB to a users home dir, I have tried mobile accounts but the syncing has been giving me some issues. I have now decided to enable local managed accounts and to let users backup a complete copy of their home dir, my AppleScript lest me do this well but I have a slight issue.
I cannot seem to find a way to output the progress of the backup in AppleScript, the backup works fine but I need to show the users for feedback so the know when the backup is finished.
Here is the script:
tell application "Finder"
if not (exists disk "BACKUP") then
display dialog "No Backup Disk Detected"
quit
end if
if exists disk "BACKUP" then
set CurrentUser to do shell script "whomami"
set question to display dialog "What would you like to sync?" buttons {"From Mac","To Mac","Cancel"} default button 3
set answer to button of returned question
if answer is equal to "From Mac" then
try
do shell script "rsync -vaE --delete --update '/Users/"& CurrentUser &"/' '/Volumes/BACKUP/Sync/ '"
end try
else
if answer is equal to "To Mac" then
try
do shell script "rsync -vaE --delete --update '/Volumes/BACKUP/Sync/' '/Users/"& CurrentUser &"/'"
end try
end if
end if
end tell
Hope someone can help!!
Thanks in advance,
Si