Jump to content
Sign in to follow this  
hero_ruler

Kjøre en terminal kommado en gang i minuttet?

Recommended Posts

Lag denne fila og kall den fra kommandolinja én gang (python filnavn.py)

#! /usr/bin/python
# -*- coding: iso-8859-15 -*-
from time import sleep
from os import system

#denne endrer du
command = 'minKommando'

while 1:
    system(command)
    sleep(60)

Edited by dabear

Share this post


Link to post
Lag denne fila og kall den fra kommandolinja én gang (python filnavn.py)

#! /usr/bin/python
# -*- coding: iso-8859-15 -*-
from time import sleep
from os import system

#denne endrer du
command = 'minKommando'

while 1:
    system(command)
    sleep(60)

Nice try....Sånt gjør man med en one-liner, siden man allerede er i skallet:

while :; do kommando; sleep 1m; done

Share this post


Link to post

Jeg tenkte på corntab jeg også, men ettersom jeg forsto så ville han at det skulle kjøres i ett og samme terminalvindu hele tia, og crontab går bare i bakgrunnen eller hva?

Men uansett så trur jeg at crontab funker best til det formålet han nevner....

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...