• 0 Posts
  • 4 Comments
Joined 2 years ago
cake
Cake day: June 13th, 2023

help-circle

  • Also, I am not sure you can automatically expect the output of the find command to be assigned to the file variable. I would output the find command to a temp file, and then grab the filenames one by one from the file and then put that in a do/done loop. Eg:

    find ./ -type f \( -iname \*.jpg -o -iname \*.png \) > yourtempfile.tmp    
    for file in `cat yourtempfile.tmp`     
    do     
        echo "in loop"    
        echo "$file"    
    ....     
    done
    

    Here are some results I got when it ran:

    in loop
    ./Figs_XSR900.JPG
    ‘.’/‘Figs_XSR900.JPG’
    Renaming ./Figs_XSR900.JPG to ./356bb549-d25c-4c9b-a441-f8175f963c8c
    in loop
    ./20240625195740_411A6199.JPG
    ‘.’/‘20240625195740_411A6199.JPG’
    Renaming ./20240625195740_411A6199.JPG to ./3cc9ba51-1d15-4a10-b9ee-420a5666e3e2



  • Just as a general rule, I would start checking log files. You can start be searching /var/log for files that have been modified in the last few mins with something like “sudo find /var/log -mmin -10 -ls 2>/dev/null”. That will get you all log files in /var/log changed within the last 10 mins. Then you can tail those or grep them looking for clues. I have done searches of the entire file system looking for log files that were recently modified to find clues. It might also help to send the output to a file so you can view that and scroll up and down rather than just trying to read the output of the find, tail or grep commands. Put a “1>/{path}/filenameyouwanttouse.out” at the end of the command or you can pipe it to the tee command and it will show on the screen and write to the file you specify.