Add a cronjob to update the mirrors search database.
This commit is contained in:
parent
c243f22b9f
commit
5ac61410a4
1 changed files with 17 additions and 0 deletions
17
cronjob-update-mirrors-search-db
Executable file
17
cronjob-update-mirrors-search-db
Executable file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
RAND="$$$RANDOM"
|
||||||
|
|
||||||
|
if ionice -c3 nice -n 19 /opt/bin/updatedb -l no -o /data/sites/slackware.uk/files/search.db.$RAND -U /data/depository >/dev/null 2>&1; then
|
||||||
|
mv /data/sites/slackware.uk/files/search.db.$RAND /data/sites/slackware.uk/files/search.db 2>/dev/null || {
|
||||||
|
printf "%s: %s\\n" "${0##*/}" "failed to move mirrors search database into place" >&2
|
||||||
|
rm -f /data/sites/slackware.uk/files/search.db.$RAND
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf "%s: %s\\n" "${0##*/}" "mirrors search database update failed" >&2
|
||||||
|
rm -f "/data/sites/slackware.uk/files/search.db.$RAND"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue