iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c94d9b
)
tune cronjobs
author
Ian Kelling
<ian@iankelling.org>
Fri, 4 Mar 2022 02:52:48 +0000
(21:52 -0500)
committer
Ian Kelling
<ian@iankelling.org>
Fri, 4 Mar 2022 02:52:48 +0000
(21:52 -0500)
brc2
patch
|
blob
|
history
distro-end
patch
|
blob
|
history
filesystem/etc/systemd/system/btrfsmaint.timer
patch
|
blob
|
history
filesystem/usr/local/bin/myupgrade
patch
|
blob
|
history
machine_specific/kd/filesystem/etc/systemd/system/btrbkrust.timer
patch
|
blob
|
history
diff --git
a/brc2
b/brc2
index 9fa1010920e6767057a1699531c519423e973d4b..5cd83b2223641705ff2762871aee5b22385f33c4 100644
(file)
--- a/
brc2
+++ b/
brc2
@@
-1481,6
+1481,29
@@
runsieve() {
sed -r '/^info: filtering:/{h;d};/^info: msgid=$/N;/^info: msgid=.*left message in mailbox [^ ]+$/d;/^info: msgid=/{H;g};/^info: message kept in source mailbox.$/d' /tmp/testsieve.log
}
sed -r '/^info: filtering:/{h;d};/^info: msgid=$/N;/^info: msgid=.*left message in mailbox [^ ]+$/d;/^info: msgid=/{H;g};/^info: message kept in source mailbox.$/d' /tmp/testsieve.log
}
+# usage:
+# alertme SUBJECT
+# printf "subject\nbody\n" | alertme
+alertme() {
+ if [[ -t 0 ]]; then
+ exim -t <<EOF
+From: alertme@iankelling.org
+To: alerts@iankelling.org
+Subject: $*
+EOF
+ else
+ read sub
+ { cat <<EOF
+From: alertme@iankelling.org
+To: alerts@iankelling.org
+Subject: $sub
+
+EOF
+ cat
+ } | exim -t
+ fi
+}
+
# mail related
testexim() {
# testmail above calls sendmail, which is a link to exim/postfix.
# mail related
testexim() {
# testmail above calls sendmail, which is a link to exim/postfix.
diff --git
a/distro-end
b/distro-end
index ae628c5d31c1b409d045dbe996a3e66818bdd686..4a2b6a1e81582b7620ec3f53905165ec0618427f 100755
(executable)
--- a/
distro-end
+++ b/
distro-end
@@
-1390,7
+1390,7
@@
sd /etc/systemd/system/schrootupdate.timer <<'EOF'
Description=schrootupdate
[Timer]
Description=schrootupdate
[Timer]
-OnCalendar=*-*-* 04:20:00
+OnCalendar=*-*-* 04:20:00
America/New_York
[Install]
WantedBy=timers.target
[Install]
WantedBy=timers.target
diff --git
a/filesystem/etc/systemd/system/btrfsmaint.timer
b/filesystem/etc/systemd/system/btrfsmaint.timer
index 15bc0f6d0fcc11944a360ecc5feaf046ad30818c..761380c4e43da58cc86efd519b2664cbb0466232 100644
(file)
--- a/
filesystem/etc/systemd/system/btrfsmaint.timer
+++ b/
filesystem/etc/systemd/system/btrfsmaint.timer
@@
-2,7
+2,11
@@
Description=btrfsmaint
[Timer]
Description=btrfsmaint
[Timer]
-OnCalendar=Thu *-*-* 02:00:00
+# we could programatically get this via:
+# timedatectl show --property=Timezone | sed 's/^[^=]*=//'
+# or
+# readlink /etc/localtime | sed -r 's,^.*/([^/]+/[^/]+)$,\1,'
+OnCalendar=Thu *-*-* 02:00:00 America/New_York
[Install]
WantedBy=timers.target
[Install]
WantedBy=timers.target
diff --git
a/filesystem/usr/local/bin/myupgrade
b/filesystem/usr/local/bin/myupgrade
index 3577864d76363fbbb71ba0fd1f81850a286b217e..c206f8f7888127295a9e08864d616360122d2b12 100755
(executable)
--- a/
filesystem/usr/local/bin/myupgrade
+++ b/
filesystem/usr/local/bin/myupgrade
@@
-2,6
+2,8
@@
# Copyright (C) 2019 Ian Kelling
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2019 Ian Kelling
# SPDX-License-Identifier: AGPL-3.0-or-later
+# usage: set DEBUG env var to anything to output to stdout
+
# Note: running this inside a cronjob, it wont mail any output if we end
# up rebooting from this script.
# Note: running this inside a cronjob, it wont mail any output if we end
# up rebooting from this script.
@@
-19,6
+21,13
@@
err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $pre: $*" >&2; }
hn=$(hostname -f)
source /a/bin/bash_unpublished/source-state
hn=$(hostname -f)
source /a/bin/bash_unpublished/source-state
+d() {
+ if [[ $DEBUG ]]; then
+ pee cat "wall -n"
+ else
+ echo ok | sed 's/^/myupgrade /' | pee logger "wall -n"
+ fi
+}
myreboot() {
for x in {30..1}; do
echo "pid $$. unattended upgrade, rebooting in $((x*10)) seconds" | wall -n
myreboot() {
for x in {30..1}; do
echo "pid $$. unattended upgrade, rebooting in $((x*10)) seconds" | wall -n
@@
-26,7
+35,7
@@
myreboot() {
done
for x in {30..1}; do
if ! fuser /var/lib/dpkg/lock &> /dev/null; then
done
for x in {30..1}; do
if ! fuser /var/lib/dpkg/lock &> /dev/null; then
- echo "pid $$. unattended upgrade, rebooting now" |
pee cat "wall -n"
+ echo "pid $$. unattended upgrade, rebooting now" |
d
/a/bin/ds/keyscript-on
/sbin/reboot
exit 0
/a/bin/ds/keyscript-on
/sbin/reboot
exit 0
@@
-34,7
+43,7
@@
myreboot() {
echo "pid $$. unattended upgrade reboot waiting 10 seconds for dpkg lock" | wall -n
sleep 10
done
echo "pid $$. unattended upgrade reboot waiting 10 seconds for dpkg lock" | wall -n
sleep 10
done
- echo "pid $$. dpkg locked for 5 minutes, automatic reboot failed" |
pee cat "wall -n"
+ echo "pid $$. dpkg locked for 5 minutes, automatic reboot failed" |
d
}
}
diff --git
a/machine_specific/kd/filesystem/etc/systemd/system/btrbkrust.timer
b/machine_specific/kd/filesystem/etc/systemd/system/btrbkrust.timer
index 8866acc226499a380f6283c4b37be9ce65de5f35..4e73b09b4cdf26b3dc177c1b275a3b7419e2797e 100644
(file)
--- a/
machine_specific/kd/filesystem/etc/systemd/system/btrbkrust.timer
+++ b/
machine_specific/kd/filesystem/etc/systemd/system/btrbkrust.timer
@@
-2,7
+2,7
@@
Description=Btrbk rust timer
[Timer]
Description=Btrbk rust timer
[Timer]
-OnCalendar=*-*-* 05:00:00
+OnCalendar=*-*-* 05:00:00
America/New_York
[Install]
WantedBy=timers.target
[Install]
WantedBy=timers.target