Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to write an script which do a specific command every ten minute? I do not know if this is a loop? For example Every ten minute delete a file name foo on the home directory? or every ten minute open firefox. Update: please how to do that with out CRON I need bash script

share|improve this question
1  
possible duplicate of How do I set up a Cron job? –  i08in Jun 4 at 5:04
    
@Jobin thanks for link.For do every ten minute on the bash, Am I should learn Cron?Is there any function on the bash which do that? for every ten minute? –  lion Jun 4 at 5:07
1  
@alex - depends on what kind of loop you like most. Loop with while or if blabla not to recommend. Type with unix-system at good google search words: bash switch case script –  dschinn1001 Jun 4 at 5:10
    
@dschinn1001 yes For example I want to open firefox every ten minute.Just that I do not have knowledge about cron, but I think it will some thing on the bash script, which opens firefox or delete a file every ten minute –  lion Jun 4 at 5:15
1  
patience please - deliver script today ... –  dschinn1001 Jun 9 at 4:47

1 Answer 1

up vote 3 down vote accepted
#!/bin/sh
while :
do
  firefox
  sleep 600
done
share|improve this answer
    
little warning - while could be bad, cause it is only allowed on local machines ... –  dschinn1001 Jun 4 at 10:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.