package to move and manage folders?
![](https://whiskers.bim.boats/pictrs/image/1c78394b-f133-4eec-b756-addcf93a6fcf.webp)
![](https://lemmy.ml/pictrs/image/q98XK4sKtw.png)
Hi,
I'm looking for a package that will allow me to configure some rules for moving folders and then watch a folder and automatically move folders or files that match rules to a certain other directory. Does something like this exist?
The use case is that I have data being saved to a single directory by other devices, and then I would like to reorganize it based on the file or folder name.
Or anyone have any other ideas of how to do this?
Maybe this could help?
https://organize.readthedocs.io
inotifywait or watchexec can both watch a directory for changes then execute anything you want.
Excellent suggestion.
You can use find utility for that. I'm not at Linux machine right now, so maybe I can make mistake in commands, but something like this should work:
In this example, command find every file containing "type1name" in its name in folder /path/to/data/folder and move it into /path/to/dest/folder.
So if you have folder "~/data/all_data" containing files like "temperature_2023-06-30.csv", " temperature_2023-06-29.csv", "power_2023-06-30.csv" and "power_2023-06-29.csv", do:
More, you can tweak it into for examplee filtering according to current date and run that script every day.
systemd-path is the cleanest and most portable solution. You define a path service to watch your directory for changes and trigger another service to perform certain actions then. It uses inotify.
https://man.archlinux.org/man/systemd.path.5.en
Here is a full example from our currently so beloved redhat: https://www.redhat.com/sysadmin/introduction-path-units
If you don't find the application you're looking for maybe you can write a bash script that runs on a Cron job. It's possible if you're just talking about file/folder names
Best I can think of would be a shell script combined with Cron.
But I'd love see alternatives. Ideal with a gui imo