Page 1 of 1

Sync folder contents from smb share back to computer

PostPosted: Fri Mar 27, 2015 2:18 pm
by bigjohn
The goal is to make the contents of a folder on my Mac reflect the contents of folders on my smb share drive (a popcornhour). When I add a file to the popcornhour (PH), I want that to sync back to the Mac drive and when I move a file from FolderA to FolderB, I want it to sync to the corresponding folders (delete from FolderA, add to FolderB).

The smb share files reflect date created, date last modified and date added as all the same date (date created).

I tried to keep it simple, sync any file (as filetypes may vary and dates are irrelevant).

Thoughts?
John


The rule for FolderA on the popcornhour is:
If all of the following conditions are met
Any file
Sync into folder FolderA (on mac)

2015-03-27 10:59:32.999 hazelworker[36748] [File Event] File/folder synced: File1.mp4 synced to /Volumes/Mac Pro HD3/Misc Documents/OTHER/FolderA/File1.mp4.
2015-03-27 10:59:33.104 hazelworker[36748] File2.mp4: Rule FolderA-PH sync to FolderA-HD3 matched.
2015-03-27 10:59:33.104 hazelworker[36748] DEBUG: New rule signature. Executing actions.
Old signatures: (
)
New Signature:{TRUEPREDICATE}:{(sync:/Volumes/Mac Pro HD3/Misc Documents/OTHER/FolderA,{
})}

When I move a file from FolderA to FolderB, it adds the file to my mac as it should (same rule commands as above, this time Sync into FolderB).

2015-03-27 11:03:22.066 hazelworker[36813] [File Event] File/folder synced: File1.mp4 synced to /Volumes/Mac Pro HD3/Misc Documents/OTHER/FolderB/File1.mp4.
2015-03-27 11:03:22.068 hazelworker[36813] DEBUG: Writing out DB file: /Volumes/share/Video/OTHER/FolderB
2015-03-27 11:03:22.069 hazelworker[36813] DEBUG: Directory /Volumes/share/Video/OTHER/FolderB processed in 45.031976 seconds

The problem is that now that File1 is out of FolderA, it doesn't delete it from the corresponding folder on the mac.

2015-03-27 11:15:38.312 hazelworker[36951] Processing folder FolderA
"/Volumes/share/Video/OTHER/FolderA"
2015-03-27 11:15:40.415 hazelworker[36951] DEBUG: About to process directory /Volumes/share/Video/OTHER/FolderA
2015-03-27 11:15:40.440 hazelworker[36951] DEBUG: File2.mp4: Rule signature matched for rule FolderA-PH sync to FolderA-HD3. Not executing actions.
2015-03-27 11:15:40.441 hazelworker[36951] DEBUG: Writing out DB file: /Volumes/share/Video/OTHER/FolderA
2015-03-27 11:15:40.442 hazelworker[36951] DEBUG: Directory /Volumes/share/Video/OTHER/FolderA processed in 0.026733 seconds
2015-03-27 11:15:40.443 hazelworker[36951] Done processing folder FolderA

Re: Sync folder contents from smb share back to computer

PostPosted: Fri Mar 27, 2015 5:13 pm
by Mr_Noodle
If you want to mirror a folder from one place to another then you should use the Sync action. Read this thread on more info on how to do this: viewtopic.php?f=4&t=1593#p6500

Re: Sync folder contents from smb share back to computer

PostPosted: Fri Mar 27, 2015 5:20 pm
by bigjohn
i did use the sync action.

i spent an hour on that thread last night, downloaded the rules you posted and i'm telling you that dates don't matter on smb. you can open the file 1000 times and the date last modified will always be the creation date.

that's why i used any file in my sync rule.

it's not deleting files from the target folder. it only adds.

Re: Sync folder contents from smb share back to computer

PostPosted: Fri Mar 27, 2015 5:44 pm
by bigjohn
i adjusted the rules to run on the same drive, eliminating the smb share.

i just want changes I make in OTHER PH to be reflected in OTHER. i moved File2 from OTHER PH/FolderX to FolderY and it added it to OTHER/FolderY but didn't delete from OTHER/FolderX

Image

Image

where am i going wrong?

Re: Sync folder contents from smb share back to computer

PostPosted: Sun Mar 29, 2015 1:45 am
by bigjohn
i'm using ChronoSync for this task now. Just too hard with Hazel.*

*although I still use Hazel for 20 other tasks - indispensable!

Re: Sync folder contents from smb share back to computer

PostPosted: Mon Mar 30, 2015 11:14 am
by Mr_Noodle
Glad you got it working with Chronosync though for future reference, using "any file" here will probably not be what you want if you want it to sync beyond the first time. You really need some date based conditions in there if you want it to do anything more than once.