diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-29 23:57:32 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-30 00:22:19 +0100 |
commit | 9a057263d4bb83017d4168b08172bd95f996789e (patch) | |
tree | 5bcbeab0967e7929998f7988d05c7a62ffa7728c /virtual/miller-base | |
parent | Swap cutemarked for ghostwriter (diff) | |
download | portage-9a057263d4bb83017d4168b08172bd95f996789e.tar.bz2 portage-9a057263d4bb83017d4168b08172bd95f996789e.tar.xz portage-9a057263d4bb83017d4168b08172bd95f996789e.zip |
Better av-scan
Fixes quirks around (un/re)mounting.
Diffstat (limited to 'virtual/miller-base')
-rwxr-xr-x | virtual/miller-base/files/weekly-av-scan.cron | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/virtual/miller-base/files/weekly-av-scan.cron b/virtual/miller-base/files/weekly-av-scan.cron index c16ed8d..40cbb08 100755 --- a/virtual/miller-base/files/weekly-av-scan.cron +++ b/virtual/miller-base/files/weekly-av-scan.cron @@ -12,16 +12,24 @@ fi if [ $$ == 1 ]; then echo "Running in private namespace." echo + echo "Remounting devices with noatime..." + grep '^/dev/' /proc/mounts | cut -d ' ' -f 2 | xargs -n1 mount -n -o remount,noatime + echo + echo "Unmounting non-device file systems..." - grep -v '^\(/dev\|proc\|udev\|none\|systemd-\)' /proc/mounts | cut -d ' ' -f 2 | sort -ru | xargs umount -n + grep -v '\(^/dev/\|/run \)' /proc/mounts | cut -d ' ' -f 2 | sort -ru | xargs umount -nrl + echo - echo "Remounting remaining devices with noatime..." - grep '^/dev/' /proc/mounts | cut -d ' ' -f 2 | xargs -n1 mount -n -o remount,noatime + df -Th + echo + + grep -vw noatime /proc/mounts echo declare -a EXCL declare -A M EXCL=( + $(find /var/lib/machines/ -maxdepth 2 -name dev -type d) $(portageq distdir) $(portageq pkgdir) $(portageq get_repo_path / $(portageq get_repos /)) |