Hi. Long story short -
Trying to create backup image of bootcamp partition onto external HDD. Using winclone perl script and automatically creating and replacing relevant backup folders depending on times of previous backups. I have set up root user. I have edited sudo visudo so I am not prompted for password while running perl script and everything works . almost.
The run the script section within the applescript takes 20-30 minutes to run. Later on the Finder move action takes about 10-15 minutes to run which is why I have inserted the timeout statement to avoid Finder timing out while waiting for the move to finish.
The disk Otherstuff exists. The folder within it called Backups exists and the 3 folders within that folder called WindowsMonthlyBackups, WindowsWeeklyBackups and WindowsDailyBackups all exist. Macintosh HD:Users:leeandnessahomeocuments:windowsbackup exists.
The delete and recreate works fine. Check that Bootcamp and Otherstuff exist works fine. The perl script works fine. The Windows.sparsebundle plus 3 other files are successfully created in the folder Macintosh HD:Users:leeandnessahomeocuments:windowsbackup:backup but then it falls apart. In the example Event Log below you can see that the applescript started checking for the date of the size file if it exists and just decided to stop for no reason. I left t for an hour after it stopped but it was just hung. 4 hours later I ran it and it worked fine. On this occasion there was no need to copy files because Daily, Weekly and Monthly backups were up to date. Sometimes it runs through this section successfully and instead stops in the middle of renaming the folders section later on.
If I cut out the delete and recreate section (except the property line) and cut out the perl section, and ensure that the relevant files are already located in Macintosh HD:Users:leeandnessahomeocuments:windowsbackup:backup and ensure that a backup is required everything works fine including the copying!
Im so close and so frustrated. What is wrong please?
Here is the Applescript (sorry don't know how to present it nicely)
Here is Event Log 1 - it just stopped after establishing that file called 'size' exists. It was then supposed to get the modification date but instead just hung!
Here is Event Log 2 - 4 hours later, no problems
Trying to create backup image of bootcamp partition onto external HDD. Using winclone perl script and automatically creating and replacing relevant backup folders depending on times of previous backups. I have set up root user. I have edited sudo visudo so I am not prompted for password while running perl script and everything works . almost.
The run the script section within the applescript takes 20-30 minutes to run. Later on the Finder move action takes about 10-15 minutes to run which is why I have inserted the timeout statement to avoid Finder timing out while waiting for the move to finish.
The disk Otherstuff exists. The folder within it called Backups exists and the 3 folders within that folder called WindowsMonthlyBackups, WindowsWeeklyBackups and WindowsDailyBackups all exist. Macintosh HD:Users:leeandnessahomeocuments:windowsbackup exists.
The delete and recreate works fine. Check that Bootcamp and Otherstuff exist works fine. The perl script works fine. The Windows.sparsebundle plus 3 other files are successfully created in the folder Macintosh HD:Users:leeandnessahomeocuments:windowsbackup:backup but then it falls apart. In the example Event Log below you can see that the applescript started checking for the date of the size file if it exists and just decided to stop for no reason. I left t for an hour after it stopped but it was just hung. 4 hours later I ran it and it worked fine. On this occasion there was no need to copy files because Daily, Weekly and Monthly backups were up to date. Sometimes it runs through this section successfully and instead stops in the middle of renaming the folders section later on.
If I cut out the delete and recreate section (except the property line) and cut out the perl section, and ensure that the relevant files are already located in Macintosh HD:Users:leeandnessahomeocuments:windowsbackup:backup and ensure that a backup is required everything works fine including the copying!
Im so close and so frustrated. What is wrong please?
Here is the Applescript (sorry don't know how to present it nicely)
Code:
--
--DELETE AND RECREATE BACKUP FOLDER
--
property backup_folder : "Macintosh HD:Users:leeandnessahome:Documents:windowsbackup:backup"
ignoring application responses
tell application "Finder"
delete folder backup_folder
make new folder at folder "windowsbackup" of folder "Documents" of home with properties {name:"backup"}
end tell
end ignoring
--[LIST]
[*][LIST]
[*]CHECK THAT BOOTCAMP AND Otherstuff BOTH EXIST[/LIST] [/LIST]--
tell application "Finder"
if (exists disk "BOOTCAMP") and (exists disk "Otherstuff") then
set the run_message to true
else
set the run_message to false
end if
end tell
--[LIST]
[*][LIST]
[*]RUN THE SCRIPT[/LIST] [/LIST]--
if run_message is true then
set return_message to do shell script "sudo perl /Applications/Winclone.app/Contents/Resources/winclone.perl -image_dir=/Users/leeandnessahome/Documents/windowsbackup/backup -ntfstools_dir=/Library/NTFSProgs -create -q -remove_pagefile -image_format=diskimage -diskimagetype=sparse"
end if
--[LIST]
[*][LIST]
[*]FIND TYPE OF BACKUP[/LIST] [/LIST]--
set backup_type to "none"
if run_message is true then
tell application "Finder"
if backup_type is "none" then
set test_type to "Monthly"
set test_time to 30
if exists file "size" of folder (test_type & "1") of folder ("Windows" & test_type & "Backups") of disk "Otherstuff" then
set the Date_mod to modification date of file "size" of folder (test_type & "1") of folder ("Windows" & test_type & "Backups") of disk "Otherstuff"
if Date_mod > ((current date) - test_time) then set backup_type to test_type
else
set backup_type to test_type
end if
end if
if backup_type is "none" then
set test_type to "Weekly"
set test_time to 7
if exists file "size" of folder (test_type & "1") of folder ("Windows" & test_type & "Backups") of disk "Otherstuff" then
set the Date_mod to modification date of file "size" of folder (test_type & "1") of folder ("Windows" & test_type & "Backups") of disk "Otherstuff"
if Date_mod > ((current date) - test_time) then set backup_type to test_type
else
set backup_type to test_type
end if
end if
if backup_type is "none" then
set test_type to "Daily"
set test_time to 1
if exists file "size" of folder (test_type & "1") of folder ("Windows" & test_type & "Backups") of disk "Otherstuff" then
set the Date_mod to modification date of file "size" of folder (test_type & "1") of folder ("Windows" & test_type & "Backups") of disk "Otherstuff"
if Date_mod > ((current date) - test_time) then set backup_type to test_type
else
set backup_type to test_type
end if
end if
end tell
end if
--[LIST]
[*][LIST]
[*]MOVE BACKUP FOLDERS AND CREATE NEW BACKUP FOLDER[/LIST] [/LIST]--
if backup_type is "none" then
beep
else
tell application "Finder"
with timeout of (50 * 60) seconds
if exists folder (backup_type & "5") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" then delete folder (backup_type & "5") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff"
delay 10
if exists folder (backup_type & "4") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" then set name of folder (backup_type & "4") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" to (backup_type & "5")
delay 10
if exists folder (backup_type & "3") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" then set name of folder (backup_type & "3") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" to (backup_type & "4")
delay 10
if exists folder (backup_type & "2") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" then set name of folder (backup_type & "2") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" to (backup_type & "3")
delay 10
if exists folder (backup_type & "1") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" then set name of folder (backup_type & "1") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" to (backup_type & "2")
delay 10
make new folder at folder ("Windows" & backup_type & "Backups") of disk "Otherstuff" with properties {name:backup_type & "1"}
delay 10
copy every item in folder backup_folder to folder (backup_type & "1") of folder ("Windows" & backup_type & "Backups") of disk "Otherstuff"
end timeout
end tell
end if
Code:
tell application "Finder"
delete folder "Macintosh HD:Users:leeandnessahome:Documents:windowsbackup:backup"
current application
make new folder at folder "windowsbackup" of folder "Documents" of home with properties {name:"backup"}
current application
exists disk "BOOTCAMP"
true
exists disk "Otherstuff"
true
end tell
tell current application
do shell script "sudo perl /Applications/Winclone.app/Contents/Resources/winclone.perl -image_dir=/Users/leeandnessahome/Documents/windowsbackup/backup -ntfstools_dir=/Library/NTFSProgs -create -q -remove_pagefile -image_format=diskimage -diskimagetype=sparse"
"current size is 129321926656
partition id is 0x07
partition format is NTFS
diskimagetype is sparse
image path is /Users/leeandnessahome/Documents/windowsbackup/backup/WindowsImage device is /dev/disk2
cleaning up: Mounting Disk
Volume BOOTCAMP on /dev/disk0s3 mounted"
end tell
tell application "Finder"
exists file "size" of folder "Monthly1" of folder "WindowsMonthlyBackups" of disk "Otherstuff"
true
get modification date of file "size" of folder "Monthly1" of folder "WindowsMonthlyBackups" of disk "Otherstuff"
date "Wednesday, September 15, 2010 18:52:00"
current date
date "Friday, September 17, 2010 17:53:50"
exists file "size" of folder "Weekly1" of folder "WindowsWeeklyBackups" of disk "Otherstuff"
true
Code:
tell application "Finder"
delete folder "Macintosh HD:Users:leeandnessahome:Documents:windowsbackup:backup"
current application
make new folder at folder "windowsbackup" of folder "Documents" of home with properties {name:"backup"}
current application
exists disk "BOOTCAMP"
true
exists disk "Otherstuff"
true
end tell
tell current application
do shell script "sudo perl /Applications/Winclone.app/Contents/Resources/winclone.perl -image_dir=/Users/leeandnessahome/Documents/windowsbackup/backup -ntfstools_dir=/Library/NTFSProgs -create -q -remove_pagefile -image_format=diskimage -diskimagetype=sparse"
"current size is 129321926656
partition id is 0x07
partition format is NTFS
diskimagetype is sparse
image path is /Users/leeandnessahome/Documents/windowsbackup/backup/WindowsImage device is /dev/disk2
cleaning up: Mounting Disk
Volume BOOTCAMP on /dev/disk0s3 mounted"
end tell
tell application "Finder"
exists file "size" of folder "Monthly1" of folder "WindowsMonthlyBackups" of disk "Otherstuff"
true
get modification date of file "size" of folder "Monthly1" of folder "WindowsMonthlyBackups" of disk "Otherstuff"
date "Wednesday, September 15, 2010 18:52:00"
current date
date "Friday, September 17, 2010 21:38:44"
exists file "size" of folder "Weekly1" of folder "WindowsWeeklyBackups" of disk "Otherstuff"
true
get modification date of file "size" of folder "Weekly1" of folder "WindowsWeeklyBackups" of disk "Otherstuff"
date "Thursday, September 16, 2010 17:52:08"
current date
date "Friday, September 17, 2010 21:38:44"
exists file "size" of folder "Daily1" of folder "WindowsDailyBackups" of disk "Otherstuff"
true
get modification date of file "size" of folder "Daily1" of folder "WindowsDailyBackups" of disk "Otherstuff"
date "Thursday, September 16, 2010 22:26:45"
current date
date "Friday, September 17, 2010 21:38:45"
end tell
tell current application
beep
end tell