Dextrose/Updater

From Sugar Labs
< Dextrose
Revision as of 20:03, 27 November 2010 by Alsroot (talk | contribs) (Created page with "== Configuration == Edit {{Code|/etc/default/dextrose-update}} configuration file: DEXTROSE_YUM_REPO=''name-of-yum-repository-with-dextrose-packages'' == Install == Create {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Configuration

Edit /etc/default/dextrose-update configuration file:

DEXTROSE_YUM_REPO=name-of-yum-repository-with-dextrose-packages

Install

Create /usr/sbin/dextrose-update, main execution file:

#!/bin/sh

name="dextrose-update"

. /etc/default/${name}

yum="/usr/bin/yum --disablerepo=* --enablerepo=${DEXTROSE_YUM_REPO} --skip-broken --quiet"
logfile="/var/log/${name}"

updates=$(${yum} -e0 check-update | awk '/./{print $1 "-" $2}')
[ "${updates}" ] || exit 0

echo "$(date) Update ${DEXTROSE_YUM_REPO}" >> $logfile
echo ${updates} >> $logfile
${yum} -y update >> $logfile 2>&1

Create cron task:

ln -s /usr/sbin/dextrose-update /etc/cron.daily/

Logs

Logging records are collected in /var/log/dextrose-update.