LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-22-2005, 12:49 PM   #1
AJones
Member
 
Registered: Feb 2005
Posts: 95

Rep: Reputation: 16
Cron Job Syntax for a task in seconds


Hi:

I have two important questions to me.

1. I setup a system Debian recently, and as an additional user, When I right click on the Devices Icons like HD, Cdrom, DVD-Rom, I get a menu panel that states only Actions -> Zip, or Zip & E-mail.

I want extra ones, Like Rename, Move-toTrash, Actions -> Play Music, Open With.

How do I create or borrow this from the root?

2. I want the exact cron job syntax for performing a task every 10 or 20 seconds

*/6 * * * * cp something

is this possible?

Thanks
AJ
 
Old 07-22-2005, 01:29 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Re: Cron Job Syntax for a task in seconds

Quote:
Originally posted by AJones

2. I want the exact cron job syntax for performing a task every 10 or 20 seconds

*/6 * * * * cp something

is this possible?
First off, that would execute the commands every 6 minutes. Secondly, cron only has 1-minute resolution, and therefore is not suitable for executing something every 10 or 20 seconds. If you want that, add this to your crontab:
Code:
@reboot /PATH_TO_SCRIPT_BELOW
and create a script containing:
Code:
#!/bin/bash
while true 
do <<EXECUTE YOUR COMMANDS HERE>>
sleep 20 #this will make the next iteration 20 seconds after the previous
done
 
Old 07-22-2005, 01:56 PM   #3
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Thanks:

Anybody got some answers for the first question.

I tried this does this work

* * * * * cp something s20

s20 for sleep?

Will give your script a shot.

Thanks,
AJ
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting a cron task in a script Slith(++1) Programming 3 11-21-2005 05:17 AM
How to schedule *interactive* task with at or cron fast_rizwaan Linux - Newbie 4 09-09-2005 07:26 PM
Why does CUPS print after 15 seconds whether the job is ready or not? Izzard Linux - General 2 12-11-2003 04:36 AM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 10:57 AM
automating a job to occur every 60 seconds Tigger Linux - General 1 05-29-2003 12:40 AM


All times are GMT -5. The time now is 01:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration