Commit daf8360e authored by sveseli's avatar sveseli
Browse files

remove microsecond from timestamp; add cron job script

parent ac3d259e
#!/bin/sh
#
# Script used for syncing APS user accounts
# Usage:
#
# $0
#
CURRENT_DIR=`pwd`
MY_DIR=`dirname $0` && cd $MY_DIR && MY_DIR=`pwd`
cd $CURRENT_DIR
DM_ROOT_DIR=$MY_DIR/..
DM_ENV_FILE=${DM_ROOT_DIR}/setup.sh
if [ ! -f ${DM_ENV_FILE} ]; then
echo "Environment file ${DM_ENV_FILE} does not exist."
exit 2
fi
. ${DM_ENV_FILE} > /dev/null
DM_CONFIG_FILE=$DM_ROOT_DIR/../etc/dm.aps-user-update-utilities.conf
# Simply run update command after sourcing setup file
dm-update-users-from-aps-db --config-file=$DM_CONFIG_FILE --quiet
......@@ -109,6 +109,7 @@ fi
oracleDir=$DM_SUPPORT_DIR/opt/oracle-client/$DM_HOST_ARCH
if [ -d $oracleDir ]; then
LD_LIBRARY_PATH=$oracleDir:$LD_LIBRARY_PATH
PATH=$oracleDir:$PATH
fi
# Get back to where we were before invoking the setup script
......
__version__ = "0.13 (2016.05.27)"
__version__ = "0.14 (2016.10.13)"
......@@ -150,6 +150,10 @@ Description:
# datetime cannot handle time zone at the moment
timeZonePos = dmLastUpdate.rfind('-')
dmLastUpdate = dmLastUpdate[0:timeZonePos]
# remove microseconds from the timestamp
secondPos = dmLastUpdate.rfind('.')
if secondPos > 0:
dmLastUpdate = dmLastUpdate[0:secondPos]
dmLastUpdate = datetime.datetime.strptime(dmLastUpdate, '%Y-%m-%d %H:%M:%S')
if not dmLastUpdate or dmLastUpdate < apsLastChangeDate:
# User needs update
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment