On 10/25/19 4:14 AM, home user wrote:
The thing I'm now trying to do is automate the cleaning out of things left
behind by akmod(?) after the weekly patch (dnf upgrade). A cron job seems like
the most natural way to do this. Since the patches are weekly, I believe the
cron job should be weekly, scheduled for a day and time when the workstation is
almost always up, but idling.
Here is my current /var/cache/akmods/nvidia/ directory:
-----
-bash.29[nvidia]: ls -la
total 60628
drwxr-xr-x. 2 root root 57344 Oct 24 11:01 .
drwxr-xr-x. 3 akmods akmods 4096 May 15 18:42 ..
-rw-r--r--. 1 root root 535759 Oct 17 14:06
430.40-1-for-5.3.5-200.fc30.x86_64.log
-rw-r--r--. 2 root root 535714 Oct 24 11:01
430.40-1-for-5.3.6-200.fc30.x86_64.log
-rw-r--r--. 1 root root 12081124 Oct 3 11:54
kmod-nvidia-5.2.17-100.fc29.x86_64-430.40-1.fc29.x86_64.rpm
-rw-r--r--. 1 root root 12081040 Oct 10 10:11
kmod-nvidia-5.2.18-100.fc29.x86_64-430.40-1.fc29.x86_64.rpm
-rw-r--r--. 1 root root 12081932 Oct 10 15:31
kmod-nvidia-5.2.18-200.fc30.x86_64-430.40-1.fc30.x86_64.rpm
-rw-r--r--. 1 root root 12078996 Oct 17 14:06
kmod-nvidia-5.3.5-200.fc30.x86_64-430.40-1.fc30.x86_64.rpm
-rw-r--r--. 1 root root 12078980 Oct 24 11:01
kmod-nvidia-5.3.6-200.fc30.x86_64-430.40-1.fc30.x86_64.rpm
-rw-r--r--. 2 root root 535714 Oct 24 11:01 .last.log
-bash.30[nvidia]:
-----
I have a few questions:
* Best practice is to have the job run as which user?
* I gather from the man pages for cron and crontab that there are multiple
crontabs. Best practice for this is to use which one?
* Is the command "rm -rf /var/cache/akmods/nvidia/*" good, overkill, or not
enough"
* Is best practice to edit the appropriate crontab with my favorite editor, or
is there a specific tool or command that I should use?
Anything else I should know before I do this?
FWIW, once you've deleted all the files in /var/cache/akmods/nvidia only 2
files will be created when
a new kernel is installed. The log and the rpm. They will total approx
12.5MB. A rather tiny amount
to fret over, IMO.
But, if you are concerned you're going to forget about this and need to
automate it. OK. Just know
that even if you do forget it will take about 84,000 new kernels before 1GB is
used.
The easiest way to automate this is to place the "script" which deletes the
files in that directory
in a file in /etc/cron.weekly maybe calling it 98-akmod-clean and having its
ownership root:root
and executable.
--
The key to getting good answers is to ask good questions.
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org