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
5f5ca777
Commit
5f5ca777
authored
May 03, 2021
by
Holger Levsen
Browse files
maintenance: cleanup sbuild dirs using sudo and after 3 days already
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
bdc4ca89
Changes
4
Hide whitespace changes
Inline
Side-by-side
bin/reproducible_maintenance.sh
View file @
5f5ca777
...
@@ -396,7 +396,7 @@ if [ ! -z "$OLDSTUFF" ]; then
...
@@ -396,7 +396,7 @@ if [ ! -z "$OLDSTUFF" ]; then
echo
echo
echo
"Warning: Tried, but failed to delete these schroot sessions:"
echo
"Warning: Tried, but failed to delete these schroot sessions:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
"Manual cleanup needed"
echo
"Manual cleanup needed
.
"
fi
fi
echo
echo
DIRTY
=
true
DIRTY
=
true
...
@@ -426,7 +426,7 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
...
@@ -426,7 +426,7 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
echo
echo
echo
"Warning: Tried, but failed to delete these in
$dir
:"
echo
"Warning: Tried, but failed to delete these in
$dir
:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
"Manual cleanup needed"
echo
"Manual cleanup needed
.
"
fi
fi
echo
echo
DIRTY
=
true
DIRTY
=
true
...
@@ -457,7 +457,7 @@ cleanup_old_schroots() {
...
@@ -457,7 +457,7 @@ cleanup_old_schroots() {
echo
echo
echo
"Warning: Tried, but failed to delete these
$OBJECTS
:"
echo
"Warning: Tried, but failed to delete these
$OBJECTS
:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
"Manual cleanup needed
!
"
echo
"Manual cleanup needed
.
"
fi
fi
echo
echo
DIRTY
=
true
DIRTY
=
true
...
@@ -475,7 +475,7 @@ if [ ! -z "$OLDSTUFF" ]; then
...
@@ -475,7 +475,7 @@ if [ ! -z "$OLDSTUFF" ]; then
echo
"Warning: schroots older than 1 month found in /schroot:"
echo
"Warning: schroots older than 1 month found in /schroot:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
echo
echo
"Manual cleanup needed
!
"
echo
"Manual cleanup needed
.
"
echo
echo
DIRTY
=
true
DIRTY
=
true
fi
fi
...
@@ -483,20 +483,21 @@ fi
...
@@ -483,20 +483,21 @@ fi
# remove too old sbuild directories
# remove too old sbuild directories
dir
=
/var/lib/sbuild/build
dir
=
/var/lib/sbuild/build
if
[
-d
$dir
]
;
then
if
[
-d
$dir
]
;
then
echo
"
$(
date
-u
)
- Removing sbuild directories older than
7
days."
echo
"
$(
date
-u
)
- Removing sbuild directories older than
3
days."
OLDSTUFF
=
$(
find
"
$dir
"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+6
-exec
ls
-lad
{}
\;
)
OLDSTUFF
=
$(
find
"
$dir
"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+6
-exec
ls
-lad
{}
\;
)
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
if
[
!
-z
"
$OLDSTUFF
"
]
;
then
echo
echo
echo
"sbuild directories older than
7
days found, which will be deleted:"
echo
"sbuild directories older than
3
days found, which will be deleted:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
echo
find
"
$dir
"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+
6
-exec
rm
-r
{}
\;
find
"
$dir
"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+
2
-exec
sudo
rm
-r
f
--one-file-system
{}
\;
OLDSTUFF
=
$(
find
"
$dir
"
-mindepth
1
-maxdepth
1
-type
d
-mtime
+
6
-exec
ls
-lad
{}
\;
)
OLDSTUFF
=
$(
find
"
$dir
"
-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 sbuild directories:"
echo
"Warning: Tried, but failed to delete these sbuild directories:"
echo
"
$OLDSTUFF
"
echo
"
$OLDSTUFF
"
echo
"Manual cleanup needed"
echo
echo
"Manual cleanup needed."
fi
fi
echo
echo
DIRTY
=
true
DIRTY
=
true
...
...
hosts/common/etc/sudoers.d/jenkins
View file @
5f5ca777
...
@@ -22,6 +22,7 @@ jenkins ALL= \
...
@@ -22,6 +22,7 @@ jenkins ALL= \
/bin/rm -rf --one-file-system /chroots/*, \
/bin/rm -rf --one-file-system /chroots/*, \
/bin/rm -rf --one-file-system /schroots/*, \
/bin/rm -rf --one-file-system /schroots/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /var/lib/sbuild/build/*, \
/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/mv /chroots/* /schroots/*, \
/bin/mv /chroots/* /schroots/*, \
...
...
hosts/ionos10-amd64/etc/sudoers.d/jenkins
View file @
5f5ca777
...
@@ -18,6 +18,7 @@ jenkins ALL= \
...
@@ -18,6 +18,7 @@ jenkins ALL= \
/bin/rm -rf --one-file-system /schroots/*, \
/bin/rm -rf --one-file-system /schroots/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /srv/workspace/chroots/*, \
/bin/rm -rf --one-file-system /srv/workspace/chroots/*, \
/bin/rm -rf --one-file-system /var/lib/sbuild/build/*, \
/bin/mv /chroots/* /schroots/*, \
/bin/mv /chroots/* /schroots/*, \
/bin/mv /schroots/* /schroots/*, \
/bin/mv /schroots/* /schroots/*, \
/bin/umount -l /chroots/*, \
/bin/umount -l /chroots/*, \
...
...
hosts/jenkins/etc/sudoers.d/jenkins
View file @
5f5ca777
...
@@ -20,6 +20,7 @@ jenkins ALL= \
...
@@ -20,6 +20,7 @@ jenkins ALL= \
/bin/rm -rf --one-file-system /chroots/*, \
/bin/rm -rf --one-file-system /chroots/*, \
/bin/rm -rf --one-file-system /schroots/*, \
/bin/rm -rf --one-file-system /schroots/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /srv/workspace/pbuilder/*, \
/bin/rm -rf --one-file-system /var/lib/sbuild/build/*, \
/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/rm -v /var/lib/schroot/*, \
...
...
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