JoeSchmuck / Multi-Report

FreeNAS/TrueNAS Script for emailed drive information.
43 stars 0 forks source link

/tmp usage #5

Open Sophist-UK opened 1 month ago

Sophist-UK commented 1 month ago

Files that Multi-Report puts in /tmp occupy memory. When I just looked (script having run 6 hours ago) there was a complete copy of the HDD version of the MR directory including the PDF instructions in /tmp using memory.

The script should:

  1. Limit what is copied to /tmp in the first place
  2. Clean up after itself when it completes i.e. by ensuring that all files are located in the /tmp/Multi-Report directory and this directory is emptied just before the script completes.

Looking at the file listing this may be the files unpacked after a download for upgrading as none of the shell and executable files have the execute bit set.

admin@TerraMaster[/tmp/Multi-Report]$ ls -lR
.:
total 8380
-rw-r--r-- 1 root root 1980592 Aug  3 10:50  Multi-Report_Quick_Start_Guide.pdf
-rw-r--r-- 1 root root 1420682 Aug  3 10:50  Multi_Report_User_Guide.pdf
-rw-r--r-- 1 root root    1639 Aug  3 10:50 'Questions for the visitors.txt'
-rw-r--r-- 1 root root     382 Aug  3 10:50  README.md
-rw-r--r-- 1 root root     315 Aug  3 10:50  Versioning
-rw-r--r-- 1 root root   24845 Aug  3 10:50  changelog.txt
-rw-r--r-- 1 root root      33 Aug  3 10:50  current_cksum
-rw-r--r-- 1 root root      33 Aug  3 10:50  current_cksum1
-rw-r--r-- 1 root root      35 Aug  3 10:50  current_script
-rw-r--r-- 1 root root      34 Aug  3 10:50  current_script1
-rw-r--r-- 1 root root  266624 Aug  3 10:50  gdisk
-rw-r--r-- 1 root root       1 Aug  3 10:50  messages.txt
-rw-r--r-- 1 root root  475562 Aug  3 10:50  multi_report.sh
-rw-r--r-- 1 root root  420795 Aug  3 10:50  multi_report_v3.0.1_2024_04_13.txt
-rw-r--r-- 1 root root  458363 Aug  3 10:50  multi_report_v3.0.2_2024_05_11.txt
-rw-r--r-- 1 root root  458536 Aug  3 10:50  multi_report_v3.0.3_2024_05_13.txt
-rw-r--r-- 1 root root  464557 Aug  3 10:50  multi_report_v3.0.4_2024_05_20.txt
-rw-r--r-- 1 root root  465036 Aug  3 10:50  multi_report_v3.0.5_2024_05_25.txt
-rw-r--r-- 1 root root  471137 Aug  3 10:50  multi_report_v3.0.6_2024_06_02.txt
-rw-r--r-- 1 root root  471145 Aug  3 10:50  multi_report_v3.0.6a_2024_06_07.txt
-rw-r--r-- 1 root root  475562 Aug  3 10:50  multi_report_v3.0.7_2024_06_08.txt
-rw-r--r-- 1 root root  401239 Aug  3 10:50  multi_report_v3.0_2024_03_30.txt
-rw-r--r-- 1 root root  258544 Aug  3 10:50  sgdisk
admin@TerraMaster[/tmp/Multi-Report]$ 
JoeSchmuck commented 1 month ago

Those files should not be there. All /tmp files should be removed at the end of the script. I can see it on my platform as well. Thanks for reporting it, I will add that fix to the next release as well. I'm glad these little things are popping up now, before the next release. I was almost done yesterday until some variables didn't want to play nice with me.

Please run the script with the -cleanup switch and that will remove the files until the next time you run the script with automatic update turned on, sorry about that.