I have a script that deletes files 7 days or older and then logs them to a folder. It logs and deletes everything correctly but when I open up the log file for viewing, its very sloppy.
log=$HOME/Deleted/$(date) find $HOME/OldLogFiles/ -type f -mtime +7 -delete -print > "$log"
The log file is difficult to read
Example File Output: (when opened in notepad)
Is there anyway to log the file nicer and cleaner? Maybe with the Filename, date deleted, and how old it was?
Any suggestions help!