|
#9
| ||||
| ||||
| Quote:
You can use the UNIX/Linux utility "Screen" to get around this. A little complicated to learn, but well worth it if you intend on performing actions like this often.
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
|
#10
| ||||
| ||||
| Is that really true? I remember running some build scripts through SSH and I remember postfixing the build command with & hoping to make it run in the background when I logged out. Imagine my disappointment when the very next day I logged in to see that the build had stopped where I logged out. |
|
#11
| ||||
| ||||
| Strange... we just tried it here with a bash shell script that looks like this: Code: #!/bin/sh sleep 15 /usr/bin/dostuff.php
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
|
#12
| ||||
| ||||
| Just thought of a situation where logging out would kill a background process, and that's precisely what you're describing, Viro... if you have a process that reads from stdin or outputs to stdout, then you MUST redirect stdin and stdout to somewhere else (files, maybe), because when you log out, stdin and stdout pipes are closed, and then the program would fail. Since compilers like cc and gcc output to stdout and stderr by default, when you log out, then next write to stdout or stderr would fail, and bring the script to a screeching halt. If you re-route stdin and stdout (and, possibly, stderr) early in the script, backgrounding your compile script then logging out should allow it to continue running.
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
|
#13
| ||||
| ||||
| Oh cool, that's probably it. I should have redirected output to a file somewhere. I never thought of that! |
|
#14
| ||||
| ||||
| You have to use the "nohup" command to detach the cp process from the terminal. "man nohup" will tell you more. "nohup" means "do not react on the HUP (hang up) signal!". The output will be redirected automatically to a file named "nohup.out". |
|
#15
| ||||
| ||||
| And you could use cpmac instead of cp to also copy the resource forks over. |