LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cron Job Syntax for a task in seconds (https://www.linuxquestions.org/questions/linux-software-2/cron-job-syntax-for-a-task-in-seconds-345739/)

AJones 07-22-2005 11:49 AM

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

Matir 07-22-2005 12:29 PM

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


AJones 07-22-2005 12:56 PM

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


All times are GMT -5. The time now is 09:24 PM.