Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
jenkins.debian.net
Commits
9f58a8df
Commit
9f58a8df
authored
Jan 18, 2020
by
Holger Levsen
Browse files
reproducible maintenance: try to unmount mount points before cleaning up old chroots
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
386c834d
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/reproducible_maintenance.sh
View file @
9f58a8df
...
@@ -412,6 +412,12 @@ echo "$(date -u) - Removing schroots older than 3 days."
...
@@ -412,6 +412,12 @@ echo "$(date -u) - Removing schroots older than 3 days."
regex
=
"/schroots/(reproducible-.+-[0-9]{1,5}|schroot-install-.+)"
regex
=
"/schroots/(reproducible-.+-[0-9]{1,5}|schroot-install-.+)"
OLDSTUFF
=
$(
find /schroots/
-maxdepth
1
-type
d
-regextype
posix-extended
-regex
"
$regex
"
-mtime
+2
-exec
ls
-lad
{}
\;
||
true
)
OLDSTUFF
=
$(
find /schroots/
-maxdepth
1
-type
d
-regextype
posix-extended
-regex
"
$regex
"
-mtime
+2
-exec
ls
-lad
{}
\;
||
true
)
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
# try to unmount mounts first
for
MP
in
$(
find /schroots/
-maxdepth
1
-type
d
-regextype
posix-extended
-regex
"
$regex
"
-mtime
+2
)
;
do
if
[
-d
$MP
/proc
]
;
then
sudo
umount
-l
$MP
/proc 2>/dev/null
fi
done
echo
echo
echo
"schroots older than 3 days found in /schroots, which will be deleted:"
echo
"schroots older than 3 days found in /schroots, which will be deleted:"
find /schroots/
-maxdepth
1
-type
d
-regextype
posix-extended
-regex
"
$regex
"
-mtime
+2
-exec
sudo rm
-rf
--one-file-system
{}
\;
||
true
find /schroots/
-maxdepth
1
-type
d
-regextype
posix-extended
-regex
"
$regex
"
-mtime
+2
-exec
sudo rm
-rf
--one-file-system
{}
\;
||
true
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment