1 #!/bin/bash 2 # SPDX-License-Identifier: GPL-2.0+ 3 # 4 # Periodically scan a directory tree to prevent files from being reaped 5 # by systemd and friends on long runs. 6 # 7 # Usage: kvm-remote-noreap.sh pathname 8 # 9 # Copyright (C) 2021 Facebook, Inc. 10 # 11 # Authors: Paul E. McKenney <paulmck@kernel.org> 12 13 pathname="$1" 14 if test "$pathname" = "" 15 then 16 echo Usage: kvm-remote-noreap.sh pathname 17 exit 1 18 fi 19 if ! test -d "$pathname" 20 then 21 echo Usage: kvm-remote-noreap.sh pathname 22 echo " pathname must be a directory." 23 exit 2 24 fi 25 26 while test -d "$pathname" 27 do 28 find "$pathname" -type f -exec touch -c {} \; > /dev/null 2>&1 29 sleep 30 30 done
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.