How do I do other tasks in the background, and transfer files with a progress bar?
Hello Gents,
Alright, so first and foremost I figured out (kinda) how to trasnfer files using rsync, and it provides me with the progress of each file as it transfers. That said, is there any way to have some kind of overall progress indicator with an ETA on the entire transfer as well as a transferred bytes/total bytes read-out? The other thing I realized is that in Windows I am able to do multiple tasks at once. How am I able to do this in Linux? Note that I'm running Ubuntu Server LTS 10.04 and I have no GUI installed. I use Putty to SSH admin the system in a Win 7 environment. |
Since you're working in terminal only, look into screen, it allows multitasking in a single virtual terminal.
|
You can start a process to the background by using an ampersand after the command, and you can bring it to the foreground with "fg"
ie: Code:
~ $ dd if=/dev/zero of=/dev/null& ie: Code:
~ $ dd if=/dev/zero of=/dev/null |
Ahh, perfect. Thank you for the quick response. Just looked up the man pages/O'reilly entry on Job Control. The problem is that I didn't know what it was called, I assumed there was some kind of Windows Task Manager tool.
Thanks again! |
Quote:
|
I personally use gnome-terminal for my command line activity.
I use tabs to separate my activities. With this I haven't needed background processes. But yes, &, bg, fg are your friends if you want to do that. I don't use background processes much because it messes up the display (stdout of the background process messes display of whatever else you're doing in the shell. You could always redirect output to a file, but that's another story |
Apologies, my earlier post should have added "if you want to view both outputs at once" in the sense of tailing log files while generating log entries (iptables + hping for example).
I wasn't aware if this was possible with screen or not.. |
there is a terminal called terminator. It is a very good multitasking terminal.
http://www.tenshu.net/p/terminator.html |
Quote:
Also, I don't understand how to use screen with Putty. It seems very complicated when compared to Job Managment, and it does the exact same thing. You are still able to monitor silence and output with Job Managment, or at least, that's what the man pages suggest. |
Quote:
|
Quote:
|
Quote:
Still, I'm always hearing about Linux security, and why would you want to install something like screen when you can simply use Job Management? I'm not trying to be argumentative, I'm just saying that when it comes to Linux there are several ways to solve a problem, and you choose the one that you find the simplest and most convenient. Just trying to understand why someone would choose something like that over Job Management, which seems easy enough to use. Still, I'll give screen a look. Definitely sounds promising, but it sounds like it would use a decent chunk of memory as well. Thanks for the help guys. As always, it's very much appreciated. |
I find the manual (on the GNU website, not the man page) for Screen quite good.
Your question is a sensible one. Say one of the things you wanted to do at the terminal was to log into another machine with ssh. You can't send Ctrl-Z to suspend the ssh process (so you can e.g. run "bg"), as it will be sent to the shell that's running remotely. Another reason for using Screen is that you can detach your session. OK, this has nothing to do with job management, but it's a useful feature. Say you wanted to log into another machine and run some long running program there. If your connection to that machine dies, then your program may die too (I'm not sure exactly what determines whether it does or not. I did a quick (and very unscientific) test and a program I was running didn't die. Odd.). With Screen, detaching the session and logging out won't kill your program. I'm sure there are other good reasons, too, but those are the (important) ones that I use Screen for. |
So how do I try this out?
sudo apt-get install screen? Or do I need to add any repos? I'm using Ubuntu Server LTS 10.04. Also, I still very much feel like a beginner when it comes to Linux. I'm sure there's a lot of use for it. I just find that amongst the server folk, adding additional (especially memory intensive) software packages is frowned upon. There is really no reason to use best practices in my situation. But, it's always nice to know how to do something with a stock install, rather than relying on software tools. I'm sure there are other applications for screen that will become readily apparent as I continue to dabble within the OS. That said, you mentioned that you can't open a new SSH session using Job Managment, but there would be little reason if you are connected locally. Also, using Job Managment remotely, a SSH connection would already be established, you're just arranging which jobs are running in the foreground/background. Still, I imagine things would get dicey if you were looking to log in as different users. |
Sorry, haven't been at LQ that much recently. Screen should be in the standard repository.
|
All times are GMT -5. The time now is 07:06 PM. |