IBT-FMI / NeuroGentooProject

1 stars 0 forks source link

Example Cron Job #12

Closed TheChymera closed 6 years ago

TheChymera commented 6 years ago

@Doeme, could you perhaps explain what's supposed to be happening with the root directory here:

#!/bin/bash

set -e

ROOT_DIR="$(dirname "$(realpath "$0")")/../"
ROOT_DIR="${1:-$ROOT_DIR}"

pushd "${ROOT_DIR}"
./exec.sh stemgentoo update
for file in roots/*/.gentoo/
do
        ./exec.sh "$file" update
done
popd

I understand neither where $0 is supposed to be coming from for the cron job, nor how this is supposed to find the BuildServer directory.

What I was able to get to work was this:

#!/bin/bash

set -e

ROOT_DIR="/root/NeuroGentooProject/BuildServer/"

pushd "${ROOT_DIR}"
buildserver stemgentoo update
for file in roots/*/.gentoo/
do
        builsderver "$file" update
done
popd

Is this missing any significant features?

Doeme commented 6 years ago

This works if you symlink the cronjob example to /etc/cron.*/, since realpath then returns the path to the buildserver root (if that root is stored inside the buildserver files)

TheChymera commented 6 years ago

availible in gebuilder.