Archiving Folders to DVD

Hi,

I am trying to find out if the following is possible:

I archive my Jobs to DVD, I have a folder that I dump all of the Jobs into that are ready to Archive into, then I sort them into DVD sized folders based on the size of all of the folders in that Job. When I hit the maximum amount of space I can burn to a disc, I create another folder, repeating this till I have all of the folders separated.

I would like to automate the sorting process if possible, so that the script would read the size of the folder and its contents, figure out if it would fit on a DVD along with other Jobs and move it into an a folder until its full. I need to keep the files together since all of my folder structures for each Job are the same.

Also, I have Jobs that span over to multiple discs, would it be possible to split them apart?

Thank you in advance for any and all help!

Hi,

a bit Offtopic, but optical mass storage devices are a “threatened species”
Hard disks are cheaper ($ per GB), faster, more flexible, more reliable

HI Stefan,

I agree and have stated my case to go that route, but unfortunately at this time, they still prefer to use DVDs.

Thank you,

Steve

Hello.

How about you selecting some of your jobs in finder then hit opt-cmd i, and looks at the size those folders take up?

It is a no scripting solution really, but I hope it helps. It is not only for laziness, but i feel it is kind of dangerous, to start meddling with large folder structures of files. You’ll have more control doing it manually.

Hello.

This should select folders containing jobs for you that fits a DVD.

Be sure to drag and drop the selection, and remember that you can undo the operation, if something goes wrong.

I am not totally sure of the size I have set for a dvd here, but if it is wrong, then the size should be less than the physical size, so that nothing goes wrong except for not exploiting the full capacity.
You’ll need the skProgressBar that is referenced in the script (its free and good looking).

I am also unsure if the decimal separator should be “.” Try the below and change to a comma if it won’t work as I expect it to. (That is change 4.7 to 4,7).

set aTenth to (1 / 10)
if aTenth = 0.1 then
	tell me
		activate
		
		display dialog "We are good"
	end tell
end if

-- Copyright 2013 © McUsr and put into public domain
-- StefanK's SKProgressBar: http://macscripter.net/viewtopic.php?pid=160302#p160302
-- DJ Bazzie Wazzie SKProgressBar code http://macscripter.net/viewtopic.php?id=40763
property scriptTitle : "DVD Sizer"
tell application "SKProgressBar"
	set floating to true
	set position to {600, 550}
	set width to 500.0
	set title to scriptTitle
	set header to "Calculating sizes"
	set header alignment to left
	set footer to "Of Folders that fits a DVD"
	set footer alignment to right
	set show window to true
	tell progress bar
		activate
		set indeterminate to true
		start animation
	end tell
end tell

set folList to {}

tell application "Finder"
	set theContainer to target of its Finder window 1
	set selection to {}
	set theFolders to every folder of theContainer as alias list
	set sz to 0
	repeat with aFolder in theFolders
		set pxPath to quoted form of POSIX path of aFolder
		set thissz to (do shell script "/usr/bin/du -ac " & pxPath & " |tail -1 |/usr/bin/sed -n 's/^\\([0-9]*\\)\\(.*\\)$/\\1/p'") as number
		try
			-- catches any wrong decimal separator
			if ((sz + thissz) / 1048576) < 4.7 then
				set sz to sz + thissz
				set end of folList to contents of aFolder
			end if
		on error e number n
			error e number n
		end try
	end repeat
	select folList
end tell
tell application "SKProgressBar"
	stop animation
	set show window to false
	quit
end tell
tell application "Finder"
	activate
	display dialog "Your selection is ready..." with title scriptTitle with icon 1 buttons {"Ok"} default button 1
end tell

Hello.

I added a test, so that it fails bluntly with an error message, if the decimal separator is wrong.