diff --git a/R/tasks/r-packages-updater.yml b/R/tasks/r-packages-updater.yml index 2f09fd9..942e59b 100644 --- a/R/tasks/r-packages-updater.yml +++ b/R/tasks/r-packages-updater.yml @@ -7,10 +7,10 @@ file: dest={{ r_packages_svn_base_dir }} state=directory - name: Cron job that installs new R packages, if any - cron: name="install new R packages" user=root cron_file=install-r-packages minute="*/10" job="/usr/local/bin/update_r_packages install >/var/log/install_r_packages 2>&1" state=present + cron: name="install new R packages" user=root cron_file=install-r-packages minute="*/10" hour="5-0,1-2" job="/usr/local/bin/update_r_packages install >/var/log/install_r_packages 2>&1" state=present - name: Cron job that upgrades existing R packages and installs new ones, if any - cron: name="install new R packages" user=root cron_file=upgrade-r-packages hour="3" job="/usr/local/bin/update_r_packages upgrade >/var/log/update_r_packages 2>&1" state=present + cron: name="install new R packages" user=root cron_file=upgrade-r-packages minute="7" hour="3" job="/usr/local/bin/update_r_packages upgrade >/var/log/update_r_packages 2>&1" state=present when: r_packages_updater tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_github', 'r_cran_pkgs', 'r_github_pkgs', 'r_packages_updater' ] diff --git a/R/templates/update_r_packages.sh.j2 b/R/templates/update_r_packages.sh.j2 index 91e42ba..4964943 100644 --- a/R/templates/update_r_packages.sh.j2 +++ b/R/templates/update_r_packages.sh.j2 @@ -75,7 +75,7 @@ function fail() { function init_env() { if [ -f $LOCK_FILE ] ; then OLDPROC=$( cat $LOCK_FILE ) - OLDPROC_RUNNING=$( ps auwwx | grep -v grep | grep $OLDPROC ) + OLDPROC_RUNNING=$( ps auwwx | grep -v grep | grep $OLDPROC | awk '{ print $2 }' ) RETVAL=$? if [ $RETVAL -eq 0 ] ; then logger "update_r_packages: $OLDPROC_RUNNING"