Hi there,
i was looking for a way to turn a find result into a kind of virtual folder.
One example use case is, that the Photos that i take during my travel is scattered into various folders like
~/Pictures/2018/01_travel_to_somewhere/Lumix
~/Pictures/2018/01_travel_to_somewhere/Phone
~/Pictures/2018/01_travel_to_somewhere/Nikon
I would love to have a folder that contains the results for
~/Pictures: find . -newermt "$(date --date="2 days ago" +"%Y-%m-%d" )"
If i could have this as a virtual folder, i could easily use whatever slideshow software to show these pictures without any big preparation time...
This is just one use case, i guess there are plenty. E.g. for Backup purposes etc. (okay, for regular backups you will rather script something...).
Maybe another use case is if you could create a samba-share of this folder and share new Photos with your family easily.
Somebody knows a software that allows something like this?
Thanks +br
sebastian
Create Virtual Folder from find result
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Create Virtual Folder from find result
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Create Virtual Folder from find result
I don't think this is what you want, but...
As a test; create a folder named
It will find all *.txt files in your Home and copy them to the dest folder reproducing the folder structure.
Like I said, probably not what you wanted
As a test; create a folder named
dest
in your Home folder, then type this into the terminal find ~/ -type f -name "*.txt" | xargs -i cp --parents "{}" dest
.It will find all *.txt files in your Home and copy them to the dest folder reproducing the folder structure.
Like I said, probably not what you wanted
Re: Create Virtual Folder from find result
Thanks!
But apparently - as you already noticed - not exactly what i wanted.
But i will remember it for other use cases - so thanks anyway!
But apparently - as you already noticed - not exactly what i wanted.
But i will remember it for other use cases - so thanks anyway!
Re: Create Virtual Folder from find result
You might be able to use exiftool to do something like that based on exif data, it wouldn't be a virtual folder but you could scan all you ~/Pictures and copy them to another sub-directory sorted by Y/M/D (or whatever) therefore combining all your different camera's pictures into common directories. Then just delete them after.
then
Code: Select all
sudo apt install libimage-exiftool-perl
man exiftool
for more info.Re: Create Virtual Folder from find result
Thanks for your input!greerd wrote:You might be able to use exiftool(...)
However, Photos was just one usecase. I was looking for something generic.
I have thought this over last night and i think it might be possible to have some script that does the search and then turn the search result absolute paths into symlinks.
This way there is no copying and deleting necessary. If i look at the photo use case it might be easily 5GB of photos that match the criteria that then need to be copied (which would not make my SSD live longer...)
The script could run in background triggered by a cronjob - depending on how up to date this must be like every 10 minutes or daily or anything in between.
Maybe i'm having a look if i can solve this puzzle with my mediocre coding skills any time soon. Of course i'll post an update here as soon as it is working - but don't have to high expectations please!
After all it is something which i call "luxury problem"... nice to have a solution for this, but can live without - and did so for multiple years. I was inspired by MiniDLNA which has a function to list the recent added Media.