How to run sleep command in vagrant file?

Member

by lily , in category: Third Party Scripts , 10 months ago

How to run sleep command in vagrant file?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 10 months ago

@lily 

To run a sleep command in a Vagrantfile, you can use the following syntax:

1
config.vm.provision "shell", inline: "sleep X"


Replace X with the number of seconds you want the VM to sleep for. Here is an example:

1
2
3
4
5
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"

  config.vm.provision "shell", inline: "sleep 60"
end


This will make the VM sleep for 60 seconds before continuing with any subsequent provisioning scripts or commands.

Related Threads:

How to run a vagrant task on "vagrant destroy"?
How to install "locate" command on vagrant?
How to install and run elasticsearch in vagrant?
How run exec command with symfony process?
How to run laravel artisan command on server?
How to run wp-cli command in the background from php?