When I run a long running command and can't be bothered to check up on it.
I start it with nohup so I can log out. It returns a which pid it was started with
bash-2.05$ nohup [command] > log.log &
Sending output to nohup.out
[1] 1247
Then I start a monitor script that mails me when the process is finished
bash-2.05$ nohup ./mail_when_finished.sh 1247 &
Script (works on solaris):
--------------------------------
#!/usr/bin/sh
trap '' 1
pid=$1
bail_out () {
mail name@domain.com <Subject: My_Job has finished
Importance: high
X-Priority: 1
My_Job has finished running.
.
!done
exit 0
}
check_it () {
while :
do
ps -p $pid > /dev/null 2>&1
case $? in
0) sleep 120 ;;
*) bail_out; exit 1 ;;
esac
done
}
check_it
---------------------
I took and modified the script from http://www.unix.com/shell-programming-scripting/3205-lightwight-process-monitor.html
Thursday, 22 May 2008
Monday, 14 January 2008
Installing Ubuntu on MacBookPro (SantaRosa)
I bought a MacBook in a weak moment but realized that OS X is overhyped.
Therefore I decided to install ubuntu 7.10. This are the steps I took (after a lot of googling).
There are a lot of information but none worked 100% for me.
The whole problem was that when I installed it, the screen was just empty or it stopped at "running local boot scripts".
Now I hope that I can follow the documentation on the web. I'll get back on that.
Therefore I decided to install ubuntu 7.10. This are the steps I took (after a lot of googling).
There are a lot of information but none worked 100% for me.
The whole problem was that when I installed it, the screen was just empty or it stopped at "running local boot scripts".
- Made a backup... with time machine.
- used boot camp to make a new partition.
- installed refit
- Downloaded ubuntu (after a lot of trying I used the "alt"-version 64 bit)
- When the install selection window is shown. Press F6. You will get boot command that you can edit. Remove "splash" and "quiet"
- Start in safe graphics mode
- After some time it will stop on "running local boot scripts"
- do a control-c and on the prompt write "startx"
- wait for a few minutes and you will get the "normal" install window.
- Install as normal, remember to choose the correct keyboard
- Important. Do not allocate 100% of your partition. It seems like Ubuntu needs to save some on the harddisk.
Now I hope that I can follow the documentation on the web. I'll get back on that.
Subscribe to:
Posts (Atom)