aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm-remote-noreap.sh
blob: 014ce68260d7844b26543e5536e2f875427c561a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0+
#
# Periodically scan a directory tree to prevent files from being reaped
# by systemd and friends on long runs.
#
# Usage: kvm-remote-noreap.sh pathname
#
# Copyright (C) 2021 Facebook, Inc.
#
# Authors: Paul E. McKenney <paulmck@kernel.org>

pathname="$1"
if test "$pathname" = ""
then
	echo Usage: kvm-remote-noreap.sh pathname
	exit 1
fi
if ! test -d "$pathname"
then
	echo  Usage: kvm-remote-noreap.sh pathname
	echo "       pathname must be a directory."
	exit 2
fi

while test -d "$pathname"
do
	find "$pathname" -type f -exec touch -c {} \; > /dev/null 2>&1
	sleep 30
done