Trim files by removing bytes from the beginning in bash
Some suggestions
Get the byte size of a file
Instead of:
&quot;$( wc -c &lt; &quot;$file_path&quot; )&quot;

use stat:
stat -c %s &quot;$file_path&quot;

=&gt; better query the file system than count the number of bytes in files, some of which can be pretty large
Redirect or copy console output to a file
Instead of enclosing the whole block between brackets, I would set up file redirection from the beginning eg:
#!/bin/bash
LOG_FILE=&quot;/tmp/test.log&quot;
exec &gt; &gt;(tee -a &quot;${LOG_FILE}&quot;) 2&gt;&amp;1

# this should show on console AND in the log file
echo &quot;Hello world $(date)&quot;

based on this example
This is more flexible, because once it's set up you don't have to bother about appending your commands, and you can disable or redefine the behavior on the fly if desired.
And the benefit is that since we are redirecting both stdout and stderr, any errors will show up in the log file as well.
Misc
I think parsing the output of ls to count files in the directory is a bit primitive. Let me think but hopefully someone will come up with a better way.