Page 1 of 1

Rule for duplicating subfolders and contents within

PostPosted: Thu Oct 20, 2016 11:37 am
by J.Atkinson40
Hello, I am going to give some background info about what I am trying to do and why and then get into the details of the rule I am trying to make. At my company we create retaining walls which are made up of a bunch of individual blocks that fit together. We have a sketcher in an Excel file that we use to keep track of which blocks we need for each job. Recently, I developed a load sheet that takes the information from the sketcher and gives us information about which blocks are going on a specific truck load and some other information. I created a general "parent" folder called jobs and then the plan is to create a subfolder for each job within the parent folder. The sketcher file and the files for the different loads will all be going into the folder for that job. The problem is that some people in the company that need access to the files are not the most tech savvy individuals and tend to always break the systems that I create somehow. My initial idea was to change the permissions for the folders so only I could delete or move the folders and the contents within, but I am not really sure how to do that server wide so my second thought was to create a Hazel rule. I want to have Hazel duplicate any new subfolders (For a new job) created in the jobs folder and move the duplicate into a backup folder that is not shared. This is pretty simple and I have already done this part. I want to do the same thing with the files in the subfolders as well, which also shouldn't be too difficult. The real issue is that I want hazel to duplicate and move any new files that are created or changed, but I don't want it to delete the duplicate in the backup folder if the file is deleted in the shared folder. The objective is to have an exact local copy of the jobs folder that changes as the shared version changes and is updated, but is not affected by anything that is moved or deleted. If anything in the question doesn't make sense let me know and I will try to clear it up. Thanks in advance for any help!

Re: Rule for duplicating subfolders and contents within

PostPosted: Fri Oct 21, 2016 10:28 am
by Mr_Noodle
First off, check out the sticky article on getting Hazel to go into subfolders. From there, you can create a separate rule to copy each file, specifying the option to copy over the folder structure as well. That should copy whatever is at the source without deleting anything.

From there, you need to determine when to do the copy. You can try doing it every time it changes ("Date modified is after date last matched") or do it on a schedule (use the "Current time" attribute).

Re: Rule for duplicating subfolders and contents within

PostPosted: Mon Oct 24, 2016 9:28 am
by J.Atkinson40
Thank you!