Jump to content

Cron Glob() 1000+ directories


The Little Guy

Recommended Posts

I want to create a cron that will run every hour or so.

 

The cron will do the following:

 

- Glob a directory for a list of directories, then check to see if there is any new directories that are not already in the database.

- Glob the previous group, for new directories in that directory, and again add to the database if there are new ones.

- Finally it will Glob again within those directories for an new files and add them to the database if they are not already added.

 

Here is my example file structure:

 

+ audio
+---- Artist1
+-------- Album1
+------------ Song1.mp3
+------------ Song2.mp3
+------------ Song3.mp3
+-------- Album2
+------------ Song1.mp3
+------------ Song2.mp3
+------------ Song3.mp3
+---- Artist2
+-------- Album1
+------------ Song1.mp3
+------------ Song2.mp3
+------------ Song3.mp3
+-------- Album2
+------------ Song1.mp3
+------------ Song2.mp3
+------------ Song3.mp3

 

So my question (using the above structure). Will this process take a VERY long time to run if there are say 1000 Artist directories each with about 3-5 album directories?

Link to comment
https://forums.phpfreaks.com/topic/153100-cron-glob-1000-directories/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.