How to use .plexignore to skip a folder

Server Version#: 4.84.1

I have a hidden systems files folder (called " gsdata ") inside my primary Photo Library folder that I cannot delete for various reasons. Despite the folder being hidden, Plex picks it up in the scan and displays it as a folder in my Photo Library. I want to use “.plexignore” so that this sub-folder of my Photo Library is ignored and not added to Plex. I have tried all the combinations of .plexignore that I could find online but after the scan the .plexignore file is automatically deleted and the folder remains in Plex. Can someone please advise the correct way to create and write the .plexignore file so this folder can be excluded? Thank you.

Screen Shot 2022-08-14 at 09.59.57
Screen Shot 2022-08-14 at 10.00.14

Note that I have also tried adding the .plexignore file directly INSIDE the " gsdata " folder I want exclude using the “.” and “*” wildcard but it doesn’t work.

Your placement and contents of the file look correct to me. What concerns me is that the file is getting deleted. I haven’t used the .plexignore file in a while, but I’m pretty sure Plex doesn’t delete it. So I’d be looking for whatever is doing that. Could an antivirus program be quarantining it?

Thank you for the reply. I don’t have an antivirus program on the MacMini. Also, what’s very strange is that only the .plexignore file saved inside the master Photo Library file gets deleted. When I try to add the .plexignore file using the wildcard inside the gsdata folder itself, it does NOT get deleted. So it’s definitely the Plex scan that removes the .plexignore file. I guess it’s good that Plex is at least recognizing that the file is there but isn’t acting on it.

So my entry text of: # Ignore folder called “gsdatagsdata/ is correct? I saw some examples that used an additional underscore (_) prior to the folder name to be excluded; so in my case it would be “_gsdata” - could this be the issue?

I don’t know the examples you’re referring to. All I’m aware of is Plex’s documentation. By that, if your folder name is _gsdata_ the line *_gsdata_/* appears correct, with the .plexignore file in the same folder that contains the _gsdata_ folder.

Like I said, I don’t have a lot of experience in this area, so hopefully a ninja will step in.

Goodsync is probably deleting the file.

(It might be nice if Plex ignored Hidden or System Files & Folders.)

@Volts

Plex does ignore 'dot` files.

Ignoring ‘underscore’ files isn’t commonly done because _ is a legal filename character AND people use it (strange-- but they do)

Is this MacOS-specific or Plex-wide?

Ahh! Sorry.

I’m not suggesting ignoring underscores. I mean files where the filesystem flag Hidden is set.

Those _gsdata_ folders have (macOS apfs/hfs+) chflags hidden _gsdata_ applied. The Windows FAT/NTFS equivalent would be attrib +h _gsdata_.

But on *nix it’s complicated. Modern filesystems support storing extended attributes, but interacting with them is hard. Most userspace programs just ignore them.

So it would be mildly nice if Plex ignored Hidden files, but since it’s OS & filesystem-specific, and pretty rare even on macOS and Windows, I understand why it doesn’t.


This is fun reading - the convention that dotfiles are hidden was an accident:

Thank you very much @beckfield and @Volts. @Volts I totally agree with you, I don’t understand why Plex doesn’t ignore hidden file systems automatically. @ChuckPa what would be a possible solution here in your opinion? If the underscore (_) is a legal filename character then the way I wrote the .plexignore file should be working since I added the underscores in the folder name exactly as it’s written. However, I get the feeling that those underscores might be causing an issue so would it make sense for me to create a .plexignore file that asks Plex to ignore any folder that contains the words “gsdata” anywhere in the folder name? If yes, what would be the correct way to write that script? Thank you!

If the .plexignore file is being deleted, I’m 99% sure it’s not Plex doing it.

Make sure logging is set to Debug, recreate the problem, share server logs here.

Plexignore follows a regex with the globbing (wildcard) which isn’t always obvious.

Biggest rule is to NOT try to micromanage it.
Example.

*/_* doesn’t ignore _
_* does. <----- THIS IS PROBABLY WHAT YOU WANT ?

*/*.mkv doesn’t ignore mkv’s like you think it does
*.mkv does ignore ALL the MKV files in the library section (the section will appear to lose content)

Adding the directory-relative qualifier ( */ ) is often counter productive

Ignoring a single directory Directory-One/*.mkv will ignore

–BUT–

If you’re ignoring an entire directory tree – WHY is it in there ??

Bottom line…

  1. A directory is a file name in a higher-level directory. It has the added flag IS_DIR
  2. Use .plexignore to ignore FileNames. The rest will occur naturally.

My Animated library before applying .plexignore

My library after:

  1. Create .plexignore
chuck@ds418:/volume1/Animated$ cat .plexignore 
#
# Ignore MKV files
*.mkv

chuck@ds418:/volume1/Animated$ 

  1. Scan Files (Empty Trash is turned OFF)

All my animated media is structured:

Animated/
  .plexignore
.chuck@ds418:/volume1/Animated$ cat .plexignore 
#
# Ignore MKV files
*.mkv

chuck@ds418:/volume1/Animated$ 
.
.
  Name (Year)/
     Name (Year).mkv

Thank you @ChuckPa. Unfortunately this directory gsdata is created by a third-party sync program called GoodSync and I cannot remove it. I wish I could but I can’t and that’s why it’s hidden by default…yet Plex is still picking it up. Your example above is helpful but it relates to ignoring mkv files. Would it be possible for you to please type out the example of ignoring an entire directory (folder)? It would be most helpful.

I edited my .plexignore file at the moment to the following based on your suggestion above (see screenshot).

Screen Shot 2022-08-15 at 10.57.42

I removed the / and it still doesn’t work and the gsdata folder is still in Plex, HOWEVER the .plexignore file is no longer being deleted after the scan (@Volts).

Thank you everyone for your help on this.

@Bisa2

You might indeed see it in your logs but nothing below it should be scanned.
The scanner will know to stop at that directoryt

I see you’re using wildcards. Leading and trailing wildcards are where it gets goofy.
Don’t think like Windows with *.* . Linux and MacOS (unix base) aren’t that way.

Have you tested putting the name as it appears.

# ignore _gsdata_
_gs*

# or the name itself
_gsdata_

I can write one but I don’t nest directories, except Music and TV series, within directories for structure.
Can you give me an example of what you’d like to ignore so I can craft one for you?

EDIT: Think I can create one for you. I’m adding series to my test system’s TV library. I’ll work with that.

@Bisa2

I have an example for you:

In this example, I’ve opted to show selective ignoring of Star Trek and Stargate

Before:

.plexignore contents

# Ignore Star Trek and Stargate entire Series which are in TV.

Star*/

After: (notice I have not clicked “Empty Trash” so you can see what will be removed/ignored)

My folder structure here:

MyMedia/
  TV/                      <-- Plex points here
    .plexignore
    Star Trek (1966)/
    Star Trek Continues/
    Star Trek Deep Space Nine/
    Star Trek Discovery/
    Star Trek Enterprise/
    Star Trek Strange New Worlds/
    Star Trek The Next Generation/
    Star Trek Voyager/
    Stargate Atlantis/
    Stargate SG-1/
    Stargate Universe/

@ChuckPa thank you very much for taking the time to write out that example; I appreciate it.

Unfortunately I tried what you suggested above, with various combinations of text for .plexignore file, and none of them worked. I don’t know why this is. Maybe because the gsdata folder is a hidden folder. I’m note sure.

The only thing I didn’t try was to completely delete my Photo library from Plex and rebuild it from scratch with the .plexignore file saved inside. Maybe the “Scan Library” is not enough to delete the folder. Would this help? I would prefer not to have to do this since it’s a lot of work.

Please see here below some of the different text combinations for the .plexignore file that I’ve tried.

Screen Shot 2022-08-20 at 09.34.08
Screen Shot 2022-08-20 at 09.30.20
Screen Shot 2022-08-20 at 09.32.20
Screen Shot 2022-08-20 at 09.21.32

Any further suggestions are welcome, if not I may give up.

Thank you.

@Bisa2

I don’t know how MacOS does things but what I do know:

  1. Unix, which MacOS came from, doesn’t ‘hide’ files at the filesystem.
  2. If an application wishes to hide files then that’s at the application level.
    – Example: Synology and QNAP hide all @ files from being displayed (typically @eaDir, @Snapshots, etc).
    – In the scanner, we must expressly tell the it to ignore any files or directory names which begin with @

Here is a test for you.

  1. open a terminal session
  2. cd to a directory where these _gsdata_ are found -or- one level above them
  3. Type the following command
find . -type d -name '_gsdata_' -print
  1. This command will find any directories named _gsdata_ from the current directory down to the bottom and print out the path to that directory.

  2. If you get output, you have proof the files aren’t being “hidden” the way you think they are. MacOS applications are hiding them but the file system is providing truth.

When you print that out, there should also be a pattern forming.

highlight the first several directories in the terminal window and COPY to your clipboaard (usually right-click COPY)

Type the following
``` (back-tick / grave character usually to the left of the 1 key top left)
Paste the text here
```

It will look like:

Paste the text here

It far easier to manage and read on my end

@Bisa2

Here is another example.

Structure is:

  1. Main folder is: /volume1/glock/qa/gsdata ( a bunch of video files I copied )
chuck@ds418:/volume1/glock/qa/gsdata$ ls
'1917 Slice-001.zip'                             photos                                                        test.zip
 Cameraperson.mkv                               "Pinky And The Brain - S02E01 - It's Only a Paper World.avi"  'The Tomorrow War (2021) - [WEBDL-1080p][EAC3 5.1][H264]_Trim.mp4'
'Cheers - 4x04 - The Groom Wore Clearasil.mp4'  'Queen Rock Montreal (2007)'                                  'The Tomorrow War (2021) - [WEBDL-1080p][EAC3 5.1][H264]_Trim.zip'
'dolby-vision-onoff-(www.demolandia.net).ts'     sample.zip                                                   'Thor Ragnarok Slice-001.zip'
 Error-BTTF.mkv                                  Shield-TrueHD-Atmos-underrun.txt                              TLK.mkv
'Fight Club'                                     Shield-TrueHD-Atmos-underrun.zip                              ToyStory3.xxx
 _gsdata_                                       'Sintel (2010)'                                                TS3%-eac3.srt
 HF2.zip                                        'Sony Bravia OLED 4K Demo.mp4'                                 user-h
'LG Colors of Journey HDR UHD 4K Demo.mkv'       stutter-bttf.mkv                                              user-V
 Microsoft-Authenticator-code                    Subtitles                                                    'Wonder Woman 1984 Slice-001.zip'
 ok-ferris.mkv                                   Tangled
chuck@ds418:/volume1/glock/qa/gsdata$
  1. Create a subfolder _gsdata_ (just like you have)
  2. Moved the videos contents under _gsdata_
  3. Created .plexignore in the top folder (my gsdata example directory)
    _gsdata_ is underneath there.
chuck@ds418:/volume1/glock/qa/gsdata$ ls _gsdata_/videos/
'1917 Slice-001.mkv'                                      DP-5Mbps-hevc-sdr.mkv                                  'Katy Perry - The Prismatic World Tour Live (2015)-001.mkv'   Test_3GP_Video_320x240_30mb.3gp
 4K-HEVC-2600-CPU.mkv                                     DP-HB-1080p-10MB-H264-AAC-.mkv                          KK.mkv                                                       The.Big.Bang.Theory.S12E09.720p.HDTV.x264-AVS.mkv
'Baraka (1992).mkv'                                       DP-HB-1080p-10MB-HEVC-AAC-.mkv                          P81_GlassBlowing2_1920x1080@59.94fps_15200kbps_fmp4.mp4     'The Matrix'
 BigSneakers.mkv                                          DP-HB-1080p-5MB-HEVC-AAC-.mkv                           P81_GlassBlowing2_3840x2160@59.94fps_15200kbps_fmp4.mp4     'The Matrix Reloaded'
 CaptainRedhat-BlackPanther.mkv                           GMan-audio.mkv                                          p8.1.mpd                                                    'Thor Ragnarok Slice-001.mkv'
'Cars (2006)'                                             GMan-no-audio.mkv                                       PlexInTheCloud-TestFile.mkv                                 'Toy Story 2a.mkv'
'Celine Dion A New Day (2007).mkv'                        HF.mp4                                                 'Scorpion - S02E20 - Djibouti Call WEBDL-1080p.mkv'          'Toy Story 3 (2010).mkv'
'Celine Through the Eyes of the World (2010).mkv'         Hidden_Figures-001.mkv                                  Star.Trek.2009.true-hd_7.1.mkv                               TrueHD-sync-Shield.mkv
'Chronos (1985).mkv'                                      Hidden_Figures-002.mkv                                 'Taxi 5 (2018) Bluray-1080p.mkv'                              TS3%-eac3.mkv
 ChuckPa-BP.mkv                                           House.S01E18.720p.HDTV.x264-BlueBIRD.mkv               'Taxi 5 - playlist 0.mkv'                                    'Wonder Woman 1984 Slice-001.mkv'
 clip_with_missing_sub.mp4                               'IMAX - Chronos (1985).mkv'                             'Taxi 5 - playlist 1.mkv'                                     WW-10Mbps-hevc.mkv
'Dave Matthews and Tim Reynolds Live at Radio City.mkv'   iOS_P5_GlassBlowing2_1920x1080@59.94fps_15200kbps.mp4  'Taxi 5- playlist 1.mkv'                                      ww1984_30s_riivin_ffmpeg.mkv
 Dolby_Unfold_Lossless_ATMOS-thedigitaltheater.mkv       'REMUX -The Martian - Extended Edition.mkv'   TB.mp4                                                       WW-5Mbps-hevc.mkv
'dolby-vision-onoff-MKV-(www.demolandia.net).mkv'        'The Martian.mkv'                               Test_3GP_Video_176x144_10mb.3gp                              XmlkTV-FPE-error.mkv
chuck@ds418:/volume1/glock/qa/gsdata$ 
  1. .plexignore contents
chuck@ds418:/volume1/glock/qa/gsdata$ cat .plexignore
_gsdata_/

chuck@ds418:/volume1/glock/qa/gsdata$
  1. Created an Other Videos library section which will simply grab ALL video files which aren’t ignored.

  2. When the library is finished, there are only 20 video files.
    The videos folder itself contains another 50+ video files

  3. I remove the .plexignore. Observe the results.

I don’t know how much cleaner an example I can give you than this.

If you can’t get this result.

  1. Make certain the .plexignore is in the top-most folder Plex points to.
    AT MINIMUM, it is above what you’re trying to ignore.
  2. You don’t need wildcards in a case like this where the directory has the same name _gsdata_
  3. Make certain your DEBUG logging is enabled and VERBOSE is disabled.
  4. Repeat the scan.
  5. Download the logs ZIP file.

@ChuckPa thank you very much for taking the time to write this all out. It seems the issue has been resolved now.

In case this helps for others with this issue, here is what I did:

(Note: the I am using a program called Good Sync to back up my photo library saved on OneDrive to an external hard drive connect to a MacMini that acts as the server connected to Plex that creates my Photo Media Library. When using GoodSync, a hidden systems folder called “_ gsdata _” is automatically created inside the top folder that is being synced between OneDrive and the External Drive. Plex was picking this hidden folder up in its scan thinking it was a media folder.)

  1. Manually deleted the hidden folder “_ gsdata _” from my Pictures Library top folder

  2. Ran the Plex scan on the library so that the erroneous _ gsdata _ media sub-folder was removed from Plex

  3. I created the .plexignore file and saved it inside the master Pictures Library folder (i.e. the top folder). I used the text that @ChuckPa suggest above, see here below:

/Volumes/Mega Bisa Photos + Music/Pictures Library$ cat .plexignore
_ gsdata _/

/Volumes/Mega Bisa Photos + Music/Pictures Library$

  1. I ran the GoodSync scan again, which caused the hidden systems folder “_ gsdata _” to reappear inside the Pictures Library top folder.

  2. I then re-ran the Plex directory scan on this Photos library and the erroneous “_ gsdata " media folder has NOT yet reappeared. I have been testing this and re-running the Scan Library for the past several days and the " gsdata _” media folder has not shown up in Plex.

I am not sure right now if it was my temporary manual deletion of the hidden systems folder or the .plexignore file that solved the issue. If the issue appears again, I will update this thread.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.