Basically , i ran a script on my droplet / virtual server. It ran well , i use digital ocean console. The next day i connected using the mac terminal, added SSH key, and bash ./thescript from the terminal, the script runs well, without stopping i went to digital ocean console terminal and open it up the script is not running.
I thought to myself maybe when i close the terminal on my mac it wont ran.
So i ran the script FIRST on DIGITAL OCEAN console.
Then connect to the droplet on my TERMINAL MAC local device. Script does not have the output.
Thank you for your time.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
If you need the script to run constantly even if you close your SSH session, I would recommend using screen.
To start a new screen session run:
screen -S SOME_NAME_HERE
Then inside the screen session run your script. After that to detach from the screen session press CTRL+A+D.
Then even if you close your terminal the script would remain running in the screen session.
If you need to attach back to the screen session run:
screen -R SOME_NAME_HERE
To list the available screen sessions run:
screen -ls
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.