Separate exam-mode stuff in own role
This commit is contained in:
parent
43157dd810
commit
3d01394820
13 changed files with 493 additions and 472 deletions
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# rename -exam directories in /home and /lmn/media older than 12h
|
||||
# remove -exam.* directories in /home and /lmn/media older than 10d
|
||||
#
|
||||
|
||||
set -eu
|
||||
|
||||
for dir in /home/ /lmn/media ; do
|
||||
if [[ -d "${dir}" ]]; then
|
||||
find "${dir}" -maxdepth 1 -mindepth 1 -name '*-exam' -type d -cmin +720 \
|
||||
-exec bash -c 'mv "$0" "$0".$( date +%Y%m%d-%H%M --reference="$0" )' {} \;
|
||||
find "${dir}" -maxdepth 1 -mindepth 1 -name '*-exam.*' -type d -cmin +14400 \
|
||||
-exec rm -rf {} \;
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue