Difference between revisions of "Dextrose/Updater"

From Sugar Labs
Jump to navigation Jump to search
(Created page with "== Configuration == Edit {{Code|/etc/default/dextrose-update}} configuration file: DEXTROSE_YUM_REPO=''name-of-yum-repository-with-dextrose-packages'' == Install == Create {...")
(No difference)

Revision as of 20:03, 27 November 2010

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.