FAQ |
Kalender |
![]() |
#1 | |||
|
||||
Administratör
|
Om man startar ett script som loopar i oändlighet via crontab håller det på tills det blir nåt fel på servern
![]() Hur startat man ett script som loopar även om man loggar av, utan att hålla på och böka med att lägga in det i crontab? WN
__________________
Snickare - Copenhagen - Stockholm - Shoppasmart - Bilverkstad - flig.ht/s - Stockholm - Nöje - Direct Flights - PopularHotels.com - TOBUY Sverige - Pengar.se. |
|||
![]() |
![]() |
![]() |
#2 | ||
|
|||
Flitig postare
|
Citat:
annars måste du nog göra det till en "daemon" i själva programmet... |
||
![]() |
![]() |
![]() |
#3 | |||
|
||||
Har WN som tidsfördriv
|
Kan man inte bara lägga det som ett bakgrundsjobb med bg eller vad nu kommandot heter?
|
|||
![]() |
![]() |
![]() |
#4 | ||
|
|||
Supermoderator
|
Citat:
|
||
![]() |
![]() |
![]() |
#5 | ||
|
|||
Mycket flitig postare
|
`nohup': Run a command immune to hangups
======================================== `nohup' runs the given COMMAND with hangup signals ignored, so that the command can continue running in the background after you log out. Synopsis: nohup COMMAND [ARG]... `nohup' increases the scheduling priority of COMMAND by 5, so it has a slightly smaller change to run. If standard output is a terminal, it and standard error are redirected so that they are appended to the file `nohup.out'; if that cannot be written to, they are appended to the file `$HOME/nohup.out'. If that cannot be written to, the command is not run. If `nohup' creates either `nohup.out' or `$HOME/nohup.out', it creates it with no "group" or "other" access permissions. It does not change the permissions if the output file already existed. `nohup' does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an `&'. The only options are `--help' and `--version'. *Note Common options::. |
||
![]() |
![]() |
![]() |
#6 | |||
|
||||
Supermoderator
|
skulle personligen använda antingen screen (om programmet använder stdout) eller nohup (om inte stdout används).
screen används genom att du startar binaryn screen, kör igång program som önskas och sedan detachar "screenen". för att sedan attacha en detachad screen skriver du enkelt "screen -r". har du flera olika screens igång anropar du screen -r med "screenid" angivet.
__________________
[ Finanstips.se | Riktnummer.se | Väderlek.se | 3W.se | WWWW.se ]
. [ Marbella.se | ValutaGraf.se | Virusprogram.se | Malta Bolag.se | Växlingskontor.se ] . |
|||
![]() |
![]() |
![]() |
#7 | ||
|
|||
Bara ett inlägg till!
|
./script.xx &
![]() brukar funka finnemang. " & " fixar allt. |
||
![]() |
![]() |
![]() |
#8 | ||
|
|||
Supermoderator
|
bg och & funkar bra till du loggar ut. Då stängs programmet av.
|
||
![]() |
![]() |
![]() |
#9 | ||
|
|||
Bara ett inlägg till!
|
& funkar ALLTID för mig.
har aldrig dött för att jag loggat ut. |
||
![]() |
![]() |
![]() |
#10 | |||
|
||||
Bara ett inlägg till!
|
Vad är det för typ av kod? Spana in C-funktionen fork()
|
|||
![]() |
![]() |
Svara |
|
|