#!/bin/bash

echo 'Updating Aliyum Source'

DATETIME=`date +%F_%T`

exec > /var/log/aliyumrepo_$DATETIME.log

     reposync -np /mirror

if [ $? -eq 0 ];then

      createrepo --update /mirror/base

      createrepo --update /mirror/extras

      createrepo --update /mirror/updates

      createrepo --update /mirror/epel

    echo "SUCESS: $DATETIME aliyum_yum update successful"

  else

    echo "ERROR: $DATETIME aliyum_yum update failed"

fi
