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
Debian QA
jenkins.debian.net
Commits
d0a30cf1
Commit
d0a30cf1
authored
Sep 05, 2020
by
Holger Levsen
Browse files
reproducible maintenance: use and allow sudo to cleanup diffoscope schroot sessions
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
dacf5211
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/reproducible_maintenance.sh
View file @
d0a30cf1
...
@@ -416,31 +416,33 @@ if [ ! -z "$OLDSTUFF" ]; then
...
@@ -416,31 +416,33 @@ if [ ! -z "$OLDSTUFF" ]; then
fi
fi
# remove too old schroot session data from diffoscope
# remove too old schroot session data from diffoscope
echo
"
$(
date
-u
)
- Removing diffoscope schroot session data older than 3 days."
if
[
"
$HOSTNAME
"
=
"
$MAINNODE
"
]
;
then
for
path
in
session union/underlay union/overlay
;
do
echo
"
$(
date
-u
)
- Removing diffoscope schroot session data older than 3 days."
dir
=
/var/lib/schroot/
$path
/
for
path
in
session union/underlay union/overlay
;
do
OLDSTUFF
=
$(
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
ls
-lad
{}
\;
)
dir
=
/var/lib/schroot/
$path
/
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
echo
echo
"data in
$dir
older than 3 days found, which will be deleted:"
echo
"
$OLDSTUFF
"
echo
if
[
"
$path
"
=
"session"
]
;
then
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
rm
-v
{}
\;
else
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
rmdir
-v
{}
\;
fi
OLDSTUFF
=
$(
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
ls
-lad
{}
\;
)
OLDSTUFF
=
$(
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
ls
-lad
{}
\;
)
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
echo
echo
echo
"
Warning: Tried, but failed to delete these in
$dir
:"
echo
"
data in
$dir
older than 3 days found, which will be deleted
:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
"Manual cleanup needed"
echo
if
[
"
$path
"
=
"session"
]
;
then
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
sudo rm
-v
{}
\;
else
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
sudo rmdir
-v
{}
\;
fi
OLDSTUFF
=
$(
find
"
$dir
"
-name
"jenkins-reproducible-*-diffoscope-*"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+2
-exec
ls
-lad
{}
\;
)
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
echo
echo
"Warning: Tried, but failed to delete these in
$dir
:"
echo
"
$OLDSTUFF
"
echo
"Manual cleanup needed"
fi
echo
DIRTY
=
true
fi
fi
echo
done
DIRTY
=
true
fi
fi
done
# find old schroots
# find old schroots
echo
"
$(
date
-u
)
- Removing schroots older than 3 days."
echo
"
$(
date
-u
)
- Removing schroots older than 3 days."
...
...
hosts/jenkins/etc/sudoers.d/jenkins
View file @
d0a30cf1
...
@@ -22,6 +22,8 @@ jenkins ALL= \
...
@@ -22,6 +22,8 @@ jenkins ALL= \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /tmp/*, \
/bin/rm -rf --one-file-system /tmp/*, \
/bin/rm -rv --one-file-system /tmp/*, \
/bin/rm -rv --one-file-system /tmp/*, \
/bin/rm -v /var/lib/schroot/*, \
/bin/rmdir -v /var/lib/schroot/*, \
/bin/mv /chroots/* /schroots/*, \
/bin/mv /chroots/* /schroots/*, \
/bin/mv /schroots/* /schroots/*, \
/bin/mv /schroots/* /schroots/*, \
/bin/umount -l /chroots/*, \
/bin/umount -l /chroots/*, \
...
...
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