Real Time Backup!

jpephoto

Registered
is it possible to backup a folder in real time!? IE i am shooting a camera tethered to a powerbook G4 and the files are coming into the computer as they are shot into a captures folder. I would like them to go into the capture folder as well as a capture folder on an external maxtor FW800 drive. I searched google for hours looking for backup programs, automator scripts, blah blah blah,.... the closest I came to doing what I wanted was making a script and enabling the folder on my desktop which I want to be mirrored to my external drive... still not able to make this work.. any insight would be appreciated.. thanks
 
'is it possible to backup a folder in real time!?' - yes.

One way would be to attach a 'Folder Action' to the folder where the camera's picture files are saved to. Have the 'Folder Action' copy any new files to the Maxtor FW800 drive. I am not sure by the vagueness, if that is what you have attempted, by the '... was making a script and enabling the folder on my desktop ...' statement.
 
yes this is what i have tried. i am just not to good at scripting.... i thought i was in the right direction with folder actions... how would the script be written? or is there one written to do this i can download directly and place in the folder action scripts.
 
something like this

on adding folder items to this_folder after receiving added_items
tell application "Finder"
move every item of container "VolumeName:Users:shortname:documents:transfer:" to "volumes:MountedVolumeName:PathToOtherFolder:" with replacing
end tell
delay 300
tell application "Finder"
delete every item of container "lebesgue:users:haar:documents:transfer:"
end tell
display dialog "The move is complete."
end adding folder items to
 
attching this script does work with what i need it to do.. the only problem is it copys all the contents of the folder I am trying to mirror every time one image is added. So when I shoot one 13 MB file it adds 6 gigs of other shots along with the one 13 MB file.. this is because of the part of the script that tells finder "with replacing" if i change to "without replacing" and complile the script then does nothing. What I want is for the script to add the files as they are added to the folder.
 
You need to use the "added_items" argument to get JUST the added items. You should also use "this_folder" instead of specifying the entire path of the folder (it's just better form that way, and more flexible).

Something like this ought to work:
Code:
on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		duplicate every item of added_items to item "backups" of this_folder
	end tell
end adding folder items to
Just be sure there's a folder (or an alias to a folder) called "backups" in the folder you attach this script to.
 
I will assume that 'lebesgue:users:haar:documents:transfer:' (of 'delete every item of container "lebesgue:users:haar:documents:transfer:"'), is also 'VolumeName:Users:shortname:documents:transfer:' (of 'move every item of container "VolumeName:Users:shortname:documents:transfer:" to "volumes:MountedVolumeName:PathToOtherFolder:" with replacing').

If so, and with Mikuro's input then ...

Code:
on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		move every item of added_items to "MountedVolumeName:PathToOtherFolder:" with replacing
		delay 300
		delete every item of container this_folder
		empty trash
	end tell
	say "The move is completed." -- A less obtrusive notification of the process completion.
end adding folder items to

Note: when using a HFS path - the 'Volumes:' does not apply; besides, in UNIX it would be '/Volumes/MountedVolumeName/PathToOtherFolder/'.

-----

You do realize that you could also just place an 'alias' of 'MountedVolumeName:PathToOtherFolder:' in your 'lebesgue:users:haar:documents:' folder, and rename the 'alias' as 'transfer'. Thus, no need to move and then delete any file(s). The file(s) will be saved directly onto the external FireWire drive ... so long as it is mounted on the PowerBook G4's Desktop. This suggestion is based on the presumption that only camera files are dynamically placed into the 'transfer' folder.
 
after making an alias of the backup drive and using mikuro's script files and folders are being duplicated and placed in the backup. the only problem is the folders are empty. i need the folders contents as well as the folders to get backup up. Ill try to make this a little more clear.

Lets say for example i am shooting into a folder called CameraTest.

I create the camera test folder on my desktop. The script is attached to the desktop folder in my home directory so when I create this folder it goes into the backup as it should.

Inside the camera test folder is 3 other folders cameratest:captures, cameratest:processed, cameratest:trash. As I shoot the files get put into these folders accordingly. I want these files to backup in the cameratest folder on my backup as I shoot them.

I think all am missing is a command to include subfolders. Is this correct?
 
something like

on adding folder items to this_folder or its subfolders after receiving added_items
tell application "Finder"
duplicate every item of added_items to item "transfer" of this_folder
end tell
end adding folder items to



I know that doesnt work but it gives you the idea of what im looking for. Anything created on the desktop or any of the subfolders of the desktop gets duplicated....
 
Back
Top