manjaro – How do I create a script to run certain sets of commands automatically on a periodic interval?
I noticed that my root partition experience a jump in the usage size by about 2 GB within the last 24 hours. I don’t install anything during this time. The only thing unusual I did was opening 50 pdf files simultaneously using Okular. Now I am left to figure out where in the / directory the sudden large-size files were created, which I decided not to pursue this time. Instead, to anticipate similar events in the future (it has happened twice by now), I want to create a script that runs automatically on a regular basis, e.g. at 09:00 PM GMT+4 everyday. This script prints the output of sudo du -sh /*, sudo du -sh /var/*, sudo du -sh /var/cache/*, sudo du -sh /var/cache/*, and sudo du -sh /usr/* (these are the places I suspected where the aforementioned large files were created) to a file store in ~/Document/mylog. Every print is preceded by the current date and time, and rolls at 30 days, meaning, the output file contains the last 30 days. My computer runs on Manjaro Linux.
Read more here: Source link
