Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:33:25+00:00 2026-06-03T10:33:25+00:00

How to start a shell script in one minute later? Suppose there are two

  • 0

How to start a shell script in one minute later?

Suppose there are two bash files a.sh and b.sh
I want to execute b.sh one minute(or several seconds) after a.sh executed.
what should I code in a.sh ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:33:26+00:00Added an answer on June 3, 2026 at 10:33 am

    Simple. you want to use ‘at’ to schedule your job. and ‘date’ to calculate your moment in the future.

    Example:

    echo b.sh | at now + 1 minute
    

    or:

    echo b.sh | at -t `date -v+60S "+%Y%m%d%H%M%S"`
    

    -v+60S adds 60 seconds to current time. You can control exactly how many seconds you want to add.

    But usually, when people wants one program to launch a minute after the other, they are not 100% sure it will not take more or less than a minute. that’s it. b.sh could be launched before a.sh is finished. or a.sh could have finished 30 seconds earlier than “planned” and b.sh could have started faster.

    I would recommend a different model. Where b.sh is launched first.
    a.sh creates a temp file when it starts. execute is tasks and delete its temp file at the end.
    b.sh watch for the temp file to be created, then deleted. and start its tasks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one shell script in my lib folder. And i want to
I'm trying to use a shell script to start a command. I don't care
I'm trying to start my Rails app with thin from the shell script. If
I'm trying to set up a shell script that will start a screen session
I want to pass many arguments to a shell script which I don't know
Possible Duplicate: Quick-and-dirty way to ensure only one instance of a shell script is
I have a Unix shell script (bash) that sources some environment variables and then
I have a python script to start a process which I want to monitor
I currently start a shell script from my Java by code looking like this:
I'm trying to get my #!/bin/sh shell script to start another application without pausing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.