Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to send my files to another server with this command:

    tar zcvf - /var/www/html | ssh root@x.x.x.x "cat > /backup.tar.gz"

And I want to send it to background with this commands "ctrl+z" and "bg" and "disown"
but when I execute "bg" It continues showing me list of files that are being processed and does not let me to run "disown".

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Do yourself a favor and just put this into a screen or tmux session and afterwards, disconnect from it. This is a much better approach then the old backgrounding/nohuping way, IMHO.

share|improve this answer
    
Sorry I did not understand. what is screen session? (I am using ssh to connect my server) –  Mehdi Azizi Jun 16 '14 at 14:59
    
After a little googling now I know what you meant. Thanks. –  Mehdi Azizi Jun 16 '14 at 15:14

As an alternative to the other answer - take a look at nohup - which lets you redirect output to a log file, and tells your process to ignore 'HANGUP' kill signals.

share|improve this answer
    
nohup does not work when command prompts for password –  Mehdi Azizi Jun 16 '14 at 16:57
    
Good point. I had assumed ssh public-private key authentication. –  Sobrique Jun 17 '14 at 8:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.