From 28aa210348e4f633a824d76e750667f0931d9fd6 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Fri, 11 Sep 2015 10:07:05 +0200 Subject: [PATCH] crontab: ease the customization of path/pythonpath now only the variable GHLISTER_ROOT at the beginning of the crontab needs to be properly customized --- bin/update-github-list | 4 ++-- etc/crontab | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/update-github-list b/bin/update-github-list index 22c93a2..7db953a 100755 --- a/bin/update-github-list +++ b/bin/update-github-list @@ -1,6 +1,6 @@ #!/bin/bash -# PYTHONPATH should be set via cron +# PYTHONPATH and PATH (for ghlister) should be set via cron # export PYTHONPATH=$HOME/src/swh-lister-github/ log_dir=$(grep log_dir ~/.config/swh/lister-github.ini | cut -f 3 -d' ') @@ -8,7 +8,7 @@ test -d "$log_dir" || mkdir -p "$log_dir" logfile="${log_dir}/$(date +%Y%m%d).log" # catchup with recent changes -$HOME/src/github-list-repos/bin/ghlister catchup &> "$logfile" +ghlister catchup &> "$logfile" # XXX: computing the following stats via this script forced to have double # configuration for shell-vs-python. Also it's unneeded: we can compute the diff --git a/etc/crontab b/etc/crontab index 24a6b1b..597cdc3 100644 --- a/etc/crontab +++ b/etc/crontab @@ -1,2 +1,4 @@ +GHLISTER_ROOT=$HOME/src/swh-lister-github + # m h dom mon dow command - 0 8 * * * $HOME/bin/update-github-list + 0 8 * * * PATH=$GHLISTER_ROOT/bin:$PATH PYTHONPATH=$GHLISTER_ROOT update-github-list