FEKO has an updater, but how do I ensure that my machines are always updated when some of them are on a compute cluster?
This how-to describes the required steps to configure the system to run the FEKO Updater automatically (periodically based on some schedule) on systems which might not have any interactive logins (e.g. pure compute nodes). Also this can be used on any system where this task should be automated without having any user to do the updates manually.
The FEKO Updater comes in two options:
Both do the same task: They update the complete FEKO installation to the latest available state.
Regarding the possible configuration options and updating scenarios, please see the chapter 'The FEKO software updater' in the FEKO UserManual. For automation the commandline version is the tool of choice, as this can be instructed using the commandline options:
Syntax: feko_update OPTION Options: --check [[usr:pwd@]proxy[:port]] check if updates are available from the FEKO webpage (by default the system proxy is used, but a custom proxy server can be specified) --check --no-proxy same as above, but suppresses the use of a proxy (including the system proxy) --check-from check if updates are available from a local repository specified by --update [[usr:pwd@]proxy[:port]] update from the FEKO webpage and then install the updates (by default the system proxy is used, but a custom proxy server can be specified) --update --no-proxy same as above, but suppresses the use of a proxy (including the system proxy) --update-from update from a local repository specified by and then install the updates. --version print the version information and then exit
To automate the process under Windows, the integrated 'Scheduled Tasks' is going to be used.
Preparation:
The recommended way is to place the call to the FEKO Updater in a Windows Batch File which then is run by the task scheduler. The reasons behind this are:
Below are some sample batch files:
@echo off set FEKO_UPDATE_LOGFILE=C:\TEMP\feko_updater.log echo ================ >> '%FEKO_UPDATE_LOGFILE%' echo Running FEKO update on machine %COMPUTERNAME% at %DATE% %TIME% >> '%FEKO_UPDATE_LOGFILE%' feko_update --update >> '%FEKO_UPDATE_LOGFILE%' 2>&1
@echo off set FEKO_UPDATE_LOGFILE=C:\TEMP\feko_updater.log set FEKO_INSTALL_DIR=%PROGRAMFILES%\FEKO echo ================ >> '%FEKO_UPDATE_LOGFILE%' echo Running FEKO update on machine %COMPUTERNAME% at %DATE% %TIME% >> '%FEKO_UPDATE_LOGFILE%' for /F 'usebackq tokens=*' %%f in (`dir /b '%FEKO_INSTALL_DIR%'`) do ( if exist '%FEKO_INSTALL_DIR%\%%f\feko_update' '%FEKO_INSTALL_DIR%\%%f\feko_update' --update >> '%FEKO_UPDATE_LOGFILE%' 2>&1 )
FEKO_INSTALL_DIR
Adding the scheduled task:
This will now add the FEKO Updater task to the list of scheduled tasks in Windows. You might want to try, if the task will execute as expected by running it manually now once (Right-click -> Run). The result schould be '0x0' for success.
This will now add the FEKO Updater task to the list of scheduled tasks in Windows. You might want to see if the task will execute as expected by running it manually now once (Right-click -> Run). The result should be '0x0' for success.
To automate the process under Linux/Unix, the CRONTAB will be used.
The recommended way is to place the call to the FEKO Updater in a Shell Script which then will be called from the CRONTAB. For the reasons, see above.
Below are some sample shell script files:
FEKO_UPDATE_LOGFILE=/tmp/feko_updater.log echo '================' >> $FEKO_UPDATE_LOGFILE host=`hostname` date=`date` echo 'Running FEKO update on machine $host at $date' >> $FEKO_UPDATE_LOGFILE if [ -f /opt/feko/6.0/bin/feko_update ] then . /opt/feko/6.0/bin/initfeko feko_update --update >> $FEKO_UPDATE_LOGFILE 2>&1 fi
FEKO_UPDATE_LOGFILE=/tmp/feko_updater.log FEKO_INSTALL_DIR=/opt/feko echo '================' >> $FEKO_UPDATE_LOGFILE host=`hostname` date=`date` echo 'Running FEKO update on machine $host at $date' >> $FEKO_UPDATE_LOGFILE for f in `ls $FEKO_INSTALL_DIR | grep -v .backup` do if [ -f $FEKO_INSTALL_DIR/$f/bin/feko_update ] then . $FEKO_INSTALL_DIR/$f/bin/initfeko feko_update --update >> $FEKO_UPDATE_LOGFILE 2>&1 fi done
Adding the CRONTAB task:
In a shell run 'crontab -e' and then add the call to the above created script with the desired schedule (see 'man crontab' for details). A sample entry could be:
crontab -e
man crontab
####################################### # FEKO Update ####################################### # Run the FEKO updater every morning at 3:00 to check for new FEKO updates 0 3 * * * /root/update_feko_script.sh
After exiting the edit mode of CRONTAB the task is scheduled and will be run.