Copy Folder Structure & Contents to Networked Linux Drive

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

Moderator: Mr_Noodle

First of all apologies if this is a straightforward answer - I have scoured the guide and searched the forums for the answer, but still can't seem to get this to work.

I have a range of Hazel rules that are automating my photo workflow - everything is working fine and I end up with a directory structure as so YYYY/MM on the Mac.

I would like to copy this structure and contents to my linux box - I seem to have this working with the following rule:

Kind is Folder
Copy to folder: pictures (mounted network drive).

Everything seems fine until I listed the files on the linux box and saw the following:

Code: Select all
   
4 -rwxr--r--  1 Mac Mac    4096 Feb  4 22:09 ._2013-02-14 at 10-38-21 - 4928 x 3264.JPG
3068 -rwxr--r--  1 Mac Mac 3138595 Feb  4 22:09 2013-02-14 at 10-38-21 - 4928 x 3264.JPG
4 -rwxr--r--  1 Mac Mac    4096 Feb  4 22:09 ._2013-02-22 at 18-30-14 - 3264 x 2448.JPG
2708 -rwxr--r--  1 Mac Mac 2771125 Feb  4 22:09 2013-02-22 at 18-30-14 - 3264 x 2448.JPG


It seems to be creating directories for each individual file and I cannot work out why this is happening.

When I list the files on MAC in terminal I don't see these folders (hidden files), so I think it must be the last step in the automation process. Effectively I'm trying to map the structure and contents to the network drive.

I could probably run a bash script on a cron to clear up these unwanted directories but would rather stem it at the source.

Any help anybody could offer would be extremely appreciated.

Kind regards
SB64
 
Posts: 2
Joined: Mon Feb 04, 2019 6:12 pm

I'm guessing that is the resource fork for the file. While resource forks are not really used much anymore it may be some odd side effect from copying to a linux filesystem that it creates a stub.

What happens if you copy stuff manually in Finder? Do you get similar files? Or how about copying on the commandline?
Mr_Noodle
Site Admin
 
Posts: 7968
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi, thanks for your reply.

I just tried to copy a file over in Finder and it's just the file that copies across:
Code: Select all
2000 -rwxr--r--  1 Mac  Mac  2047136 Feb  3 11:04 IMG_0337.JPG


But when I copy a folder via Finder I get:
Code: Select all
    4 drwxr-xr-x  2 Mac  Mac      4096 Jan 29 07:21 .
   20 drwxrwxrwx 14 root root    20480 Feb  5 20:42 ..
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-04 at 16-58-05 - 10800 x 2332.JPG
16416 -rwxr--r--  1 Mac  Mac  16804658 Jan  4  2013 2013-01-04 at 16-58-05 - 10800 x 2332.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-12 at 01-27-10 - 2448 x 3264.JPG
 1696 -rwxr--r--  1 Mac  Mac   1734405 Jan 12  2013 2013-01-12 at 01-27-10 - 2448 x 3264.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-17 at 19-42-04 - 2448 x 3264.JPG
 2852 -rwxr--r--  1 Mac  Mac   2920384 Jan 17  2013 2013-01-17 at 19-42-04 - 2448 x 3264.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-18 at 13-22-14 - 3264 x 2448.JPG
 2708 -rwxr--r--  1 Mac  Mac   2770859 Jan 18  2013 2013-01-18 at 13-22-14 - 3264 x 2448.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-18 at 13-22-25 - 2448 x 3264.JPG
 2248 -rwxr--r--  1 Mac  Mac   2301933 Jan 18  2013 2013-01-18 at 13-22-25 - 2448 x 3264.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-18 at 13-23-20 - 3264 x 2448.JPG
 3796 -rwxr--r--  1 Mac  Mac   3887036 Jan 18  2013 2013-01-18 at 13-23-20 - 3264 x 2448.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-18 at 13-23-39 - 3264 x 2448.JPG
 3088 -rwxr--r--  1 Mac  Mac   3159730 Jan 18  2013 2013-01-18 at 13-23-39 - 3264 x 2448.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-22 at 17-41-36 - 3264 x 2448.JPG
 2140 -rwxr--r--  1 Mac  Mac   2187961 Jan 22  2013 2013-01-22 at 17-41-36 - 3264 x 2448.JPG
    4 -rwxr--r--  1 Mac  Mac      4096 Feb  5 20:42 ._2013-01-23 at 09-04-01 - 3264 x 2448.JPG
 2804 -rwxr--r--  1 Mac  Mac   2868657 Jan 23  2013 2013-01-23 at 09-04-01 - 3264 x 2448.JPG


I wasn't aware of resource forks in MacOS but that certainly seems to be the case:

https://apple.stackexchange.com/questions/14980/why-are-dot-underscore-files-created-and-how-can-i-avoid-them

So many thanks for the point in the right direction - I'm going to cleanup the files on a cron job.
SB64
 
Posts: 2
Joined: Mon Feb 04, 2019 6:12 pm

If you don't want any of those files on the Linux drive, you can create a Smart Folder to match those files and have Hazel operate on that.
Mr_Noodle
Site Admin
 
Posts: 7968
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support