Putting files into folders according to type

Posted by DocWu 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Putting files into folders according to type
March 21, 2016 01:33AM
Somewhere in one of the config files, I thought I saw something where you could restrict certain directories to certain types of files. Or maybe it was direct certain types of files to certain directories. Of course, I can't find it again. Am I imagining things?

I'd like to be able to have a folder called "Photos" get filled with any image files, etc. Can this be done, or did I imagine it?

I have PirateBox running successfully on a Raspberry Pi 3 and am in the stages of customizing it for an event I will be setting it up for.

Thanks.



Edited 2 time(s). Last edit at 03/21/2016 11:02AM by DocWu.
Re: Putting files into folders according to type
March 21, 2016 09:07PM
There is no official way to do so. There is the possibility to use a clever find command to sort newly arrived files into the corresponding folder with a regular running script.
Or you start to modify droopy.
Re: Putting files into folders according to type
March 22, 2016 03:09PM
I must have imagined it then, or else I'm thinking of something from another project.

Thanks.
Re: Putting files into folders according to type
March 27, 2016 12:07PM
I think I saw somewhere an example script for that, but I can't find it for myself now..
katacarbix
Re: Putting files into folders according to type
October 12, 2016 06:24PM
Huh, that sounds really interesting. Bumping to see if anyone has any solutions
I'd use chron (google it) to run something like "mv /opt/piratebox/www/shared/Shared/upload/*.jpg /opt/piratebox/shared/Shared/Images"

(My appologies if the folder structure in not the same on yours but you get the idea.)

THere is a way you can do the same for .jpg .jpeg .png .gif etc in a single comand. then another chron job for .mp4 .mkv .mov .wmv .xvid etc