Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
I want to run my initial rsync backup command through ssh. The first backup on my DNS-321 from RHD to LHD will take a few days (tested at approx 4MB/sec). I cannot run this backup as the planned daily cronjob, since it will take so long. Thus, I am going to run the initial rsync manually.
However, if I close/lose the terminal connection for some reason, the rsync will stop. Putting an "&" at the end of the command only puts it into the background -- the process will still quit when the terminal session closes. What is the command/procedure to keep the process running to completion even after the initiating terminal closes?
Offline
Thank you, Fonz, for a point in the right direction.
Offline
Check also dtach, simpler than screen.
Offline
I always use:
echo "/path/to/program_or_script > /path/to/logfile 2>&1" | at now
The program than runs like it is started from cron (it is essentially).
I have had programs not running OK with nohup on unix OSses.
Offline
Thanks bgravato and rsd76 for the additional commands.
After doing the research into these commands:
1) screen is beyond me at this point. I see the long-term benefit of learning it so it's on my to-do list.
2) dtach looks promising, though I'm not sure it's feasible on the DNS-321, I'm going to be installing and playing with it on my Mac.
3) I've currently decided on, and implemented a mix between the echo and nohup suggestions.
I put the complicated rsync command, with redirecting the output into a logfile, into its own shell script. Make it executable. An important modification is to add the "--progress" and "--stats" options to rsync. These options give the status of the file as it's sync'ed as well as transfer speed, estimate of remaining time (for the current file), number of files remaining to sync, and total number of files checked.
Then I run the script: nohup /path/to/script & The command prompt returns and I'm free to do other things or close the shell.
Whenever I want to check up on the progress: tail -f /path/to/logfile
In case the script needs to be killed for some reason: kill -2 PID.of.script (a higher level signal [-2] is needed since we explicitly am ignoring the sighup [-1] signal). May need to "kill PID.of.children" if they don't automatically go away.
This may not be the most efficient method, but it is the easiest to implement. I figure that inefficiency couldn't add too much to an already 5+ day initial rsync run, or at least nothing I'm going to notice.
Last edited by neerav (2011-01-20 05:28:51)
Offline