Tag Info

Hot answers tagged

24

The best way to do this is using screen, which keeps the session open in a persistent way even if the connection dies (and if you want to start using it again you can do a screen -r and it will open it up again). Prefixing whatever command you want to run with screen (eg. ssh -t user@host screen command) should do the job. If you want it to run in the ...


11

Are you looking to have a persistent session that you can resume, or just to stop a disconnect from killing the exection? For the former, use screen, for the latter, nohup.


10

Answer found. For BASH, this depends on the huponexit shell option, which can be viewed and/or set using the built-in shopt command. Looks like this options is off by default, at least on RedHat-based systems. More info on the BASH man page: The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to ...


9

Is my dev trying to milk me for more cash Maybe. It could also be that he is not familiar with your web host, and he isn't in a mood to try and figure it out. Hanlon's razor may apply here. Do I really need to switch hosting Maybe, you haven't really provided enough details. You probably need to get the developer to be more specific. Can ...


9

It's important to note that while some processes take CTRL+Z to mean background, the default behavior is STOP, which does not continue execution. The safest way is to run the command with an & at the end, then run "disown" to force it to the background completely. You will not be able to foreground it again, however. If you want an easy way to keep an ...


6

As mentioned early, screen can do all the trick. But not only what you need. I've use screen for the years and now use it every time I've login into systems. Try to install screen and create ~/.screenrc with such config: sessionname vcflists startup_message off deflogin off vbell off msgminwait 0 msgwait 10 log ...


5

I agree with Warner and just want to add that you can keep the shell from sending SIGHUP with the builtin "disown" command. The bash man page contains a good description.


4

After you've used ^Z to STOP something, type "bg" to let it run in the background. "fg" will bring it back to front, as long as you haven't logged out.


4

The usual way is jobs. However, jobs doesn't see background processes which have been disowned, because they aren't attached to your shell any more. For those, you'll have to look at ps in some form or another, perhaps ps -u, depending.


3

They will show up in a pstree For example: pstree -a -h


3

If your process can source whichever of /etc/profile or /etc/bash.bashrc and their respective $HOME files, then this might work for you: screen -d -m bash --init-file background-shell-script When "background-shell-script" exits, the screen session will be sitting waiting for you at a shell prompt when you reattach with screen -r. If you reattach before ...


3

Under bash, try: nohup ruby app.rb >> /log/file 2>&1 &


3

screen -L -dmS somename ruby app.rb This will start a screen process with the name of 'somename', with all output from the program being logged to screenlog.0 in the current working directory. If you ever want to get back the application's console for some reason, you can do screen -r somename.


3

If you have access through cpanel then I dont see why he wouldn't be able to implement the cron jobs there. Unless he has a VPS with root access and for some reason runs the cronjobs as root, then I can see why he said that. Other than that, you should be able to stay with hostgator.


3

When you fork a process into the background it will still be the child process from the shell executing it. All child processes running under a shell are sent a SIGHUP upon exit. Performance varies slightly depending upon the exact situation, which is detailed verbosely in bash's manpage. Other shells likely have similar descriptions. Apache, and other ...


2

You can use the command nohup to launch the command and redirect output into a nohup output file. From the nohup man page: nohup - run a command immune to hangups, with output to a non-tty The other option is to use the screen command. The benefit of using screen is that you can reconnect to the process later.


2

Deploying a service is more than being able to get it up and running, it's being able to keep it up and running and being able to automate processes. Humans entering stuff via a web UI is not scalable; insufficient access to the hosting to be able to check crontab is a sign that automation as a whole will be difficult. The developer might be so good that ...


2

To background commands just add & after the command.


2

I've seen this alternative to a reliable ssh "like" connection: http://mosh.mit.edu/


2

Known issue, however this should have been resolved in SP1: The "Desktop Wallpaper" Group Policy setting is not applied in Windows 7 or in Windows Server 2008 R2 http://support.microsoft.com/kb/977944 https://blogs.technet.com/b/deploymentguys/archive/2009/11/20/windows-7-rtm-issue-with-group-policy-enforced-wallpaper.aspx


2

Yeah... I have been in this same situation. I ended up writing a Windows service that would check for disconnected sessions using the API exposed in wtsapi32.dll, and then for each disconnected session, if the process I wanted wasn't running in that session, I'd use that person's token (which I can steal without needing to know that person's password, the ...


2

Yes, cygwin has a very good ssh server for windows. First you should download and install this. After you can log into your windows machine with command line ssh, you can use ssh-keygen to make this passwordless and automatic. The third thing were to install python on your windows machine, which you can get from http://www.python.org/getit/windows/ . It ...


1

You can use Putty from a command line: plink mysuser@targetLinuxmachine "python '/pathtomyscript/myscript.py' &" SSH keys can be managed via PuttyAgent.


1

So you just want to run the command in the background on linux? I think you're just putting the & in the wrong place. Put the & outside of the "": ssh -n -f mysuer@targetwinmachine "python 'C:\Windowspath\myscript.py -someswitch parameter' " &


1

Add some options after your start: start /min cmd /c php -f 1.php ... This will suppress the additional command prompts.


1

Hm. If you're lucky, the ScreenHeight and ScreenWidth properties of the Win32_DesktopMonitor WMI class will be filled out on the client, which means you can easily use a VB script or Powershell script to determine the computer's desktop resolution. Get-WMIObject Win32_DesktopMonitor Now that you know the computer's resolution, you can set the appropriate ...


1

There is a group policy that specifies walpaper (or background) and another one denying user from changing it Check user configuration - admin templates - desktop


1

Try perl, the Swiss Army Chainsaw. Here's me finding the PID that holds port 80 open, then listing all the children: [me@lory ~]$ sudo netstat -apn|grep -w 80|grep LISTEN tcp 0 0 :::80 :::* LISTEN 8308/httpd [me@lory ~]$ ps -ef|perl -n -e '@j=split / */; print "@j" if ( @j[2]==8308) ...


1

I would usually do: nohup mycommand & tail -f nohup.out



Only top voted, non community-wiki answers of a minimum length are eligible