Change name of cronjob scripts.
This commit is contained in:
parent
4bce06332e
commit
903576a1bd
5 changed files with 0 additions and 0 deletions
26
cronjob-updatedb-mirrors
Executable file
26
cronjob-updatedb-mirrors
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
# Version: 0.1.0
|
||||
# Copyright (c) 2023:
|
||||
# Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
|
||||
# Licensed under the terms of the GNU General Public License version 3.
|
||||
#
|
||||
# Update the locate database used specifically for the search interface on slackware.uk.
|
||||
|
||||
# Configuration.
|
||||
DBFILE="/run/mirrors.db"
|
||||
FILETREE="/storage/md0"
|
||||
COMMAND="/usr/bin/updatedb"
|
||||
|
||||
# Sanity check.
|
||||
[[ ! -x "$COMMAND" ]] && {
|
||||
printf "%s: '%s' %s\\n" "${0##*/}" "$COMMAND" "is not executable" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Update the database.
|
||||
nice -n 19 ionice -c3 "$COMMAND" -l 0 -o "$DBFILE" -U "$FILETREE" || {
|
||||
printf "%s: %s\\n" "${0##*/}" "failed to update locate database" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue