Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schedule a job to run every 10 seconds #857

Open
cjboat opened this issue Feb 3, 2025 · 4 comments
Open

Schedule a job to run every 10 seconds #857

cjboat opened this issue Feb 3, 2025 · 4 comments

Comments

@cjboat
Copy link

cjboat commented Feb 3, 2025

Hello there.

I am trying to do a job that is supposed to run every 10 seconds, but when I import the following into the scheduler, */10 * * * * *, it just sets it at 10 minutes. Am I doing this wrong? Or does Cronicle not support that short of a timeframe?

@jhuckaby
Copy link
Owner

jhuckaby commented Feb 3, 2025

I'm so sorry, but Cronicle v1 doesn't support seconds. It only goes down to minutes, similar to cron.

Support running jobs on specific seconds, including every 10 seconds, is coming in Cronicle v2! It will be released later this year (2025).

@cjboat
Copy link
Author

cjboat commented Feb 3, 2025 via email

@jhuckaby
Copy link
Owner

jhuckaby commented Feb 3, 2025

Yeah, I think so? Something like this may work:

#!/bin/bash

echo "Launching at second 00..."
/usr/bin/your-script.sh &
sleep 10;

echo "Launching at second 10..."
/usr/bin/your-script.sh &
sleep 10;

echo "Launching at second 20..."
/usr/bin/your-script.sh &
sleep 10;

echo "Launching at second 30..."
/usr/bin/your-script.sh &
sleep 10;

echo "Launching at second 40..."
/usr/bin/your-script.sh &
sleep 10;

echo "Launching at second 50..."
/usr/bin/your-script.sh &
sleep 10;

The ampersands (&) after your launch commands should launch them in the background, allowing the overall script to continue.

@cjboat
Copy link
Author

cjboat commented Feb 3, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants