aboutsummaryrefslogtreecommitdiff
path: root/straper/db/public/cron/cron.daily
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-04-14 22:32:43 +0200
committerLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-04-14 22:32:43 +0200
commit83f7fe4b8402bab171d110703a1b1115efbc9b28 (patch)
tree19110702c7d740f6bd8ee4f5d2ebcb97442be237 /straper/db/public/cron/cron.daily
parent51d43498b07dc97d795947964534f0903cd05db5 (diff)
downloadbin-83f7fe4b8402bab171d110703a1b1115efbc9b28.tar.gz
bin-83f7fe4b8402bab171d110703a1b1115efbc9b28.zip
cleaned up many scrits and deleted some that were of no use; renamed a lot
Diffstat (limited to 'straper/db/public/cron/cron.daily')
-rw-r--r--straper/db/public/cron/cron.daily/.placeholder2
-rwxr-xr-xstraper/db/public/cron/cron.daily/0anacron12
-rwxr-xr-xstraper/db/public/cron/cron.daily/apt-compat55
-rwxr-xr-xstraper/db/public/cron/cron.daily/disk-alert4
-rwxr-xr-xstraper/db/public/cron/cron.daily/dpkg8
-rwxr-xr-xstraper/db/public/cron/cron.daily/logrotate18
-rwxr-xr-xstraper/db/public/cron/cron.daily/man-db50
-rwxr-xr-xstraper/db/public/cron/cron.daily/plocate35
-rwxr-xr-xstraper/db/public/cron/cron.daily/zfs-auto-snapshot6
9 files changed, 0 insertions, 190 deletions
diff --git a/straper/db/public/cron/cron.daily/.placeholder b/straper/db/public/cron/cron.daily/.placeholder
deleted file mode 100644
index 76cb8d0..0000000
--- a/straper/db/public/cron/cron.daily/.placeholder
+++ /dev/null
@@ -1,2 +0,0 @@
-# DO NOT EDIT OR REMOVE
-# This file is a simple placeholder to keep dpkg from removing this directory
diff --git a/straper/db/public/cron/cron.daily/0anacron b/straper/db/public/cron/cron.daily/0anacron
deleted file mode 100755
index 262530a..0000000
--- a/straper/db/public/cron/cron.daily/0anacron
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-# anacron's cron script
-#
-# This script updates anacron time stamps. It is called through run-parts
-# either by anacron itself or by cron.
-#
-# The script is called "0anacron" to assure that it will be executed
-# _before_ all other scripts.
-
-test -x /usr/sbin/anacron || exit 0
-anacron -u cron.daily
diff --git a/straper/db/public/cron/cron.daily/apt-compat b/straper/db/public/cron/cron.daily/apt-compat
deleted file mode 100755
index bde3237..0000000
--- a/straper/db/public/cron/cron.daily/apt-compat
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Systemd systems use a systemd timer unit which is preferable to
-# run. We want to randomize the apt update and unattended-upgrade
-# runs as much as possible to avoid hitting the mirrors all at the
-# same time. The systemd time is better at this than the fixed
-# cron.daily time
-if [ -d /run/systemd/system ]; then
- exit 0
-fi
-
-check_power()
-{
- # laptop check, on_ac_power returns:
- # 0 (true) System is on main power
- # 1 (false) System is not on main power
- # 255 (false) Power status could not be determined
- # Desktop systems always return 255 it seems
- if command -v on_ac_power >/dev/null; then
- if on_ac_power; then
- :
- elif [ $? -eq 1 ]; then
- return 1
- fi
- fi
- return 0
-}
-
-# sleep for a random interval of time (default 30min)
-# (some code taken from cron-apt, thanks)
-random_sleep()
-{
- RandomSleep=1800
- eval $(apt-config shell RandomSleep APT::Periodic::RandomSleep)
- if [ $RandomSleep -eq 0 ]; then
- return
- fi
- if [ -z "$RANDOM" ] ; then
- # A fix for shells that do not have this bash feature.
- RANDOM=$(( $(dd if=/dev/urandom bs=2 count=1 2> /dev/null | cksum | cut -d' ' -f1) % 32767 ))
- fi
- TIME=$(($RANDOM % $RandomSleep))
- sleep $TIME
-}
-
-# delay the job execution by a random amount of time
-random_sleep
-
-# ensure we don't do this on battery
-check_power || exit 0
-
-# run daily job
-exec /usr/lib/apt/apt.systemd.daily
diff --git a/straper/db/public/cron/cron.daily/disk-alert b/straper/db/public/cron/cron.daily/disk-alert
deleted file mode 100755
index ea987a3..0000000
--- a/straper/db/public/cron/cron.daily/disk-alert
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-df -hP | awk '$5+0 >= 90 {print}' | \
-mail -s "Disk usage warning on $(hostname)" root
-
diff --git a/straper/db/public/cron/cron.daily/dpkg b/straper/db/public/cron/cron.daily/dpkg
deleted file mode 100755
index 899572d..0000000
--- a/straper/db/public/cron/cron.daily/dpkg
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# Skip if systemd is running.
-if [ -d /run/systemd/system ]; then
- exit 0
-fi
-
-/usr/libexec/dpkg/dpkg-db-backup
diff --git a/straper/db/public/cron/cron.daily/logrotate b/straper/db/public/cron/cron.daily/logrotate
deleted file mode 100755
index 1ac1570..0000000
--- a/straper/db/public/cron/cron.daily/logrotate
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-# skip in favour of systemd timer
-if [ -d /run/systemd/system ]; then
- exit 0
-fi
-
-# this cronjob persists removals (but not purges)
-if [ ! -x /usr/sbin/logrotate ]; then
- exit 0
-fi
-
-/usr/sbin/logrotate /etc/logrotate.conf
-EXITVALUE=$?
-if [ $EXITVALUE != 0 ]; then
- /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
-fi
-exit $EXITVALUE
diff --git a/straper/db/public/cron/cron.daily/man-db b/straper/db/public/cron/cron.daily/man-db
deleted file mode 100755
index 4dd8ae0..0000000
--- a/straper/db/public/cron/cron.daily/man-db
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-#
-# man-db cron daily
-
-set -e
-
-if [ -d /run/systemd/system ]; then
- # Skip in favour of systemd timer.
- exit 0
-fi
-
-# This should be set by cron, but apparently isn't always; see
-# https://bugs.debian.org/209185. Add fallbacks so that start-stop-daemon
-# can be found.
-export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"
-
-iosched_idle=
-# Don't try to change I/O priority in a vserver or OpenVZ.
-if ! grep -Eq '(envID|VxID):.*[1-9]' /proc/self/status && \
- { [ ! -d /proc/vz ] || [ -d /proc/bc ]; }; then
- iosched_idle='--iosched idle'
-fi
-
-if ! [ -d /var/cache/man ]; then
- # Recover from deletion, per FHS.
- install -d -o man -g man -m 0755 /var/cache/man
-fi
-
-# expunge old catman pages which have not been read in a week
-if [ -d /var/cache/man ]; then
- cd /
- # shellcheck disable=SC2086
- start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \
- --oknodo --chuid man $iosched_idle -- -c \
- "find /var/cache/man -type f -name '*.gz' -atime +6 -print0 | \
- xargs -r0 rm -f"
-fi
-
-# regenerate man database
-if [ -x /usr/bin/mandb ]; then
- # --pidfile /dev/null so it always starts; mandb isn't really a daemon,
- # but we want to start it like one.
- # shellcheck disable=SC2086
- start-stop-daemon --start --pidfile /dev/null \
- --startas /usr/bin/mandb --oknodo --chuid man \
- $iosched_idle \
- -- --no-purge --quiet
-fi
-
-exit 0
diff --git a/straper/db/public/cron/cron.daily/plocate b/straper/db/public/cron/cron.daily/plocate
deleted file mode 100755
index e3b6c42..0000000
--- a/straper/db/public/cron/cron.daily/plocate
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-
-set -e
-
-UPDATEDB=/usr/sbin/updatedb.plocate
-
-# Skip if systemd timer is available.
-if [ -d /run/systemd/system ]; then
- exit 0
-fi
-
-[ -x $UPDATEDB ] || exit 0
-
-if which on_ac_power >/dev/null 2>&1; then
- ON_BATTERY=0
- on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
- if [ "$ON_BATTERY" -eq 1 ]; then
- exit 0
- fi
-fi
-
-# See ionice(1).
-IONICE=
-if [ -x /usr/bin/ionice ] &&
- /usr/bin/ionice -c3 true 2>/dev/null; then
- IONICE="/usr/bin/ionice -c3"
-fi
-
-# See nocache(1).
-NOCACHE=
-if [ -x /usr/bin/nocache ]; then
- NOCACHE="/usr/bin/nocache"
-fi
-
-flock --nonblock /run/plocate.daily.lock $NOCACHE $IONICE nice $UPDATEDB
diff --git a/straper/db/public/cron/cron.daily/zfs-auto-snapshot b/straper/db/public/cron/cron.daily/zfs-auto-snapshot
deleted file mode 100755
index 14fe006..0000000
--- a/straper/db/public/cron/cron.daily/zfs-auto-snapshot
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# Only call zfs-auto-snapshot if it's available
-which zfs-auto-snapshot > /dev/null || exit 0
-
-exec zfs-auto-snapshot --quiet --syslog --label=daily --keep=31 //