0

I have a second hard drive which has the following structure:

$ tree -L 1
.
├── Documents
├── Music
├── Pictures
└── Videos

I want to monitor these folders for changes and, if any, create a symlink of the new element (be it file or folder) into the appropriate folder in /home. Does anyone know if there are any existing tools for this already or should I just resort to creating a shell script and make use of something like good old inotify-tools?

If anyone has other clever suggestions I'm all ears.

3
  • If Linux, inotify should be able to do something. Not sure where else it is available.
    – NickD
    Jul 25, 2023 at 16:10
  • I forgot to mention it but, yes, I'm using Linux. So you think inotify is the way to go?
    – telometto
    Jul 25, 2023 at 16:13
  • It can certainly watch a set of directories for changes: do man inotifywait and see where it takes you.
    – NickD
    Jul 25, 2023 at 16:18

1 Answer 1

1

I find incron a very useful tool for this type of thing. It has some bugs and at the time of writing has not being maintained for some years but there are patches if you need them. It allows you to create incrontab file(s) which are like crontabs but react to specified file or directory events.

2
  • Interesting. Where can these patches be found?
    – telometto
    Jul 25, 2023 at 17:00
  • see the pull requests in the Github repository. I use it (v0.5.12) unpatched.
    – gogoud
    Jul 25, 2023 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .