From beb08521b1cb06aa2c282a6752c7b588326fa025 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 19 Mar 2022 14:09:23 -0400 Subject: Improve logging and change default .d dir Rather than looking at the environment varible otherwise use the local automv.d directory - set it to something more centralized in the environement e.g /usr/local/etc/automv.d/ Also the logs were unclear what was happening so extracted the find query into a function to be able to run/rerun it a few times to improve the existing logging. I wonder if there is a better way to print what is happening in the xargs w/o repeating the move a bunch: fn_mv { echo "Moving: $1 to $2" mv $1 $2 } and call: find ... | xargs -I'{}' fn_mv {} $target Perhaps? --- readme.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'readme.txt') diff --git a/readme.txt b/readme.txt index 05922ef..c2f5cfa 100644 --- a/readme.txt +++ b/readme.txt @@ -12,7 +12,7 @@ Prereqs: Setup: the script searches the directory: - ./automv.d/ + /usr/local/etc/automv.d/ for any .conf files Overriding the automv.d location: @@ -20,6 +20,10 @@ Overriding the automv.d location: AUTOMV_DIR environment variable +How it works: + it basically automates the finding of non-hidden files in the source dir + and will move them to an existing directory + automv.d/ conf syntax ===================== @@ -46,3 +50,13 @@ query=.*\.jp[e]?g source=/home/user/Downloads/ target=/home/user/Pictures/ +Nice to haves / Tasks to be done +================================ + +[ ] Better logging (timestamps n such) - we repeat the find like 3 times to be + able to get better logs / printing +[ ] More flexibility / configurability +[ ] Fault tolerance +[ ] Auto mkdir -p if the target dir doesn't exist? +[ ] Multiple queries per file? What if you have diverging regexes? does find support ORs? + -- cgit v1.2.3-54-g00ecf