I'm trying to re-rename files based on the history.xml but I don't see any ways documented in the forum or google.
I'm moving from my previous gnome seedbox to my own debian server, and now I want to re-hardlink all my files just like it was on my previous server but it seems when i was using filebot previously I didn't know of xattr and so no xattr metadata are saved so I'm trying to use the history i just updated the parent directory of my files in the history.xml and now want to know how can i hardlink them i know i might be able to do it with
Thanks very much, do you have any idea to how i can avoid the duplicate matches like files that are renamed couples times and they have couple matches in the history?
hama4reall wrote: ↑14 Jul 2024, 07:43
Thanks very much, do you have any idea to how i can avoid the duplicate matches like files that are renamed couples times and they have couple matches in the history?
What should happen if you have a couple of matches in the history? For $SRC? For $DST? For both? Define exactly what you want to do, consider all corner cases, and then modify your code accordingly.
#!/bin/sh
filebot -script fn:history --log OFF | while IFS=$'\t' read -r SRC DST
do
# require SRC to exist and require DST to not exist
if [ -f "$SRC" ] && [ ! -f "$DST" ]
then
ln -v "$SRC" "$DST"
fi
done
This is a fresh filebot installation in GUI i imported the history from my old server and closed the program the history.xml file appeared but filebot in cli doesn't show it.
Looks like you'll have to write the code entirely by yourself... Pick the language of your choice, parse the XML, do the hardlink operations. It'll be ~20 lines of code.
Hi, sorry for my late reply that day i was trying to write a script with gemini all day and i gave up from frustrating and didn't notice your comment, i just tested it and it works but i think it copies the file? Instead of hardlink is this the case?
Got i just checked it's hardlinking them so this is it, the file system is ext4 and both src and dst are one the same file system. So all of the files is hardlinked now so thanks a lot appreciate it.