Copying Photos to External Drive

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Copying Photos to External Drive Fri May 29, 2015 1:02 pm • by clreed87
Hello--

I have a Hazel rule that I'm using the make backups of my Photos.app library and for the most part it's working great. The rule monitors the "Masters" folder within the Photos library package and when new photos are added copies them to an external drive and sorts them into subfolders based on date. I also had the rule add a comment to the original file so that it wouldn't continue to process the same files--which may not actually be necessary--I'm not sure.

This was all working great until I had my external hard drive unplugged for about a week and added several photos to my library. When I returned home and connected the hard drive Hazel didn't take any action on the newly added photos (but still processes photos I've added since that time).

My suspicion is that the rule was triggering while the external drive was unplugged and labeling the file it was preparing to copy. Then the drive wasn't connected to the copy obviously was never made. Then when the drive is connected again Hazel doesn't operate on the file because of the condition I set to not operated on files with the comment added to keep it from reprocessing the entire library (again this may not be necessary--but I was afraid since I was only copying files and not moving Hazel would see every file as meeting te condition again and try to copy them).

So my question is primarily--is there a way to only have the Hazel rule run when my external drive is connected? If there isn't a way how can I make sure that Hazel doesn't reprocess my entire library every time, but still ensure new photos are copied when the drive is reconnected.

Thanks so much for the help!

-Chris
clreed87
 
Posts: 3
Joined: Fri Jul 18, 2014 4:21 pm

Re: Copying Photos to External Drive Fri May 29, 2015 1:43 pm • by Mr_Noodle
Do you add the comment before or after the copy? If before, then you might want to switch it around. If an action fails, Hazel stops processing so the file will never be commented if the copy operation fails.
Mr_Noodle
Site Admin
 
Posts: 11251
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copying Photos to External Drive Fri May 29, 2015 2:12 pm • by clreed87
I'm adding the comment just before I make the copy. I originally tried to add the comment right after the copy was made, but then I believe I was adding the comment to the copied file and not the original file. It seemed like one I made the copy any rules after that were being applied to the copy and not the original. Is that correct or should adding the comment still apply to the original copied file even if it is triggered after the file is copied?

Thanks so much for the help!
clreed87
 
Posts: 3
Joined: Fri Jul 18, 2014 4:21 pm

Re: Copying Photos to External Drive Mon Jun 01, 2015 11:22 am • by Mr_Noodle
Ah right. You are correct. That said, depending on how you structured your conditions, the file should not be copied more than once. If you do "Date added is after date last matched", it should only copy the first time the file appears. Alternatively, you can do "Date modified is after date last matched" to copy whenever the file is modified.
Mr_Noodle
Site Admin
 
Posts: 11251
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copying Photos to External Drive Mon Jun 08, 2015 10:34 am • by clreed87
Awesome thanks for the tip!

Just FYI I solved the issue by adding a quick "passes shell script" rule to check if my volume is mounted before the rule will run.

Code: Select all
if mount|grep "Data"; then
   exit 0
else
   exit 1
fi


So now the rule will only kick off if my "Data" external drive is connected. Thanks so much for the help!
clreed87
 
Posts: 3
Joined: Fri Jul 18, 2014 4:21 pm


Return to Support