Create a dynamic link to a changing folder in time

376 Views Asked by At

On my web-browser application I have a list of folder by when pictures are getting taken via security camera. Folder structure is something like:

~/security_camera/test_11_11_2011/.jpg ~/security_camera/test_12_12_2012/.jpg ... ... ... ... ~/security_camera/test_18_12_2020/*.jpg

From the linux prompt I can quickly create a link

ln -sf $(ls -d ~/security/camera/test_* | tail -1 ) LAST_UPDATED_FOLDER

That will create a link in the same folder and that I can access to see the latest folder. Is there a way to make the above link dynamic? I would not have a cronjob creating that link, but basically everytime that a new folder is getting created, then link should point to latest folder from time point of view.

Command above is not refreshing that link automatically.

0

There are 0 best solutions below