I wonder if it is possible to create such .sh script that a normal user would be capable to start with something like nohup ./superScript.sh >& /dev/null &
and which would once a minute look into some SVN, find out current version and if there was an update run commands like:
kill `ps aux | grep -F 'ServerAPP' | grep -v -F 'grep' | awk '{ print $2 }'`
./server_automated_net_setup.sh
cd server/install-dir/
export LD_LIBRARY_PATH=./:~/server/install-dir/lib_boost:~/server/install-dir/lib_openSSL
nohup ./ServerAPP >& /dev/null &
that would kill currently running app, run some auto update script we already have in users home ~
and run it again.
Is it possible to create such script and how to do it?
The script would look something like this:
This script just compares the current revision number of both the local and remote svn repositories. If the differ than it runs some commands. If they are the same, it just exists.
Then you'd just have to set up a cron job to run how often you want.
If you have access to svn server, the the better approach is to define svn postcommit hook. This way you avoid polling.
Are we there yet? Are we there yet? Are we there yet? - see how annoying is that?
Advantages of hooks over polling: