This command will run script.sh under super user and you can disconnect and come back later:
sudo nohup bash script.sh &
It’s useful if you don’t have Screen or you want the process to close when it finishes without a screen session hanging around.
By default, the output will go to nohup.out. You can change it by redirecting it to a file:
sudo nohup bash script.sh > script.out &
nohup runs a command immune to hangups. It redirects input and output of the process. If you want to connect to the server again and see the output, use tail, as below:
tail -f script.out
The command will be printing output as your command produces it as if it runs in your terminal session. Ctrl-C will terminate tail but not the nohup command.
If you need to kill the command before it finishes, find the process id first with:
sudo ps -Af | grep “bash script.sh”
sudo kill <process id>
I hope it helps.
I am opening the source of a small project that I made for a charity organisation http://evpomembers.codeplex.com.
This is a web based contact database. The database stores information on individual members with their contact details, general information and how they are connected to each other. The list of features includes:
- Editable look-ups for most fields
- Multiple contacts per one address
- Convenient search for contact names and addresses
- Log-in support to prevent unauthorized access
- Customisable export to Excel compatible XML
Minimal Software requirements:
- Microsoft SQL 2005
- .NET Framework 3.5
EVPO Members Copyright © 2012 Evgeny Pokhilko
EVPO Members is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
EVPO Members is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with EVPO Members. If not, see http://www.gnu.org/licenses.
- Download the source from the SVN repository.
- Create ContactData database in SQL and restore empty.bak
- Run apsnet_regsql from Visual Studio command line and install aspnetdb. Leave default settings mostly in the wizard.
- Create a SQL log-in (ContactDataUser for example with password 1).
- Grant access to the log-in to the ContactData and aspnetdb databases.
- Download AjaxControlToolkit (http://ajaxcontroltoolkit.codeplex.com/,go to All Downloads and download the package for .NET 3.5 !!!) for .NET 3.5 and unzip it to the AjaxControlToolkit directory.
- Open the solution and rebuild it.
- Open UI\web.config
- Update the two connection strings making them valid for the ContactData and aspnetdb databases respectively.
- In Visual Studio go to Project/ASP.NET Configuration
- On the opened web page go to Security/Create User
- Specify any user name and password so you can log in to the web app
- Ctrl+F5 in Visual Studio
- You should see the home page of the web app in your browser
2. Contact Form
- OpenGL hardware acceleration through remote X11 SSH connection
- GDB: How do I set current source file for list and break commands
- How To Create and Seed a Torrent (Ubuntu server, Transmission)
- GIT TF: Undo shallow pull and pull squashed changeset
- Lynx on Windows 7 and lynx_bookmarks.html file problem
- Old MacBook Overheating and Installation of Mac OS 10.4 on New Hard Drives
- Memory Alignment Of Structures and Classes in C++
- Align label and input vertically
- Google Test Framework and Visual Studio 2010
- Convex Hull
- Run a bash script with sudo, nohup and in the background
- Contact database with web interface – EVPO Members