-2

The hard disk of one of my servers is full, so I need to move a file away from it to make room.

I have tried tar -cvf but when I send it to the other server using wget -c, I see it is 100% complete. The problem is that the size of the file is different even though it reported being finished.

7
  • It is hard to tell what you are asking. Could you clarify?
    – Hennes
    Sep 9, 2013 at 11:28
  • i want backup file in server to another server Sep 9, 2013 at 11:34
  • 1
    Do you first create the tarball and then download it? What do you mean with 'file not finish'?
    – Hennes
    Sep 9, 2013 at 11:36
  • 3
    create a tarball and use rsync, in my experience, wget isn't good for big files, usually they are corrupted.
    – Lynob
    Sep 9, 2013 at 11:45
  • 1
    @monkey_boys i posted an answer, but please try to do a simple search before you ask, these kind of question tend to be voted down or closed for obvious reasons. If you do a search, and still unable to find an answer, then say why you need help, and everyone will help you gladly, there many tutorials out there on how to create a tar and how to use rsync, you could even search superuser - next time when you reply to someone who commented on your question, use @, to reply to me @Fischer so i can be notified that you replied to me, otherwise I may never reply to you.
    – Lynob
    Sep 9, 2013 at 12:26

1 Answer 1

3

next time when you reply to someone who commented on your question, use @, to reply to me @Fischer so i can be notified that you replied to me, otherwise I may never reply to you.

I'll link to some tutorials.

To create a tarball

you go to the file location using cd, then you do

tar -cvf example.tar /example

Then to use rsync on a RedHat-based distribution

yum install rsync

or, if you are on Debian-based distribution

apt-get install rsync

then transfer to the new server

rsync -av -e ssh username@oldserverip:/path/to/example.tar /example.tar

(note that you have the option to gzip the file on-the-fly by adding the -z flag)

and at last untar on the new server, go to where the tar is located, use ls to help you see the file.

tar -xvf example.tar
7
  • user rsync command in newserver ? Sep 9, 2013 at 13:33
  • @monkey_boys yes, in the command shown above, you need to install rsync on new server, and use rsync on new server, use the old server ip addresss, however if you want to install rsync on the old server and copy from it to new server, you'd use rsync -av -e example.tar username@newserveripaddress:~/location/where/you/want/to/transfer
    – Lynob
    Sep 9, 2013 at 14:00
  • please see the links i gave you: Task : Copy file from a local computer to a remote server
    – Lynob
    Sep 9, 2013 at 14:01
  • 1
    @monkey_boys I didn't understand the question? what is the problem?
    – Lynob
    Sep 9, 2013 at 15:31
  • 1
    @monkey_boys please read this superuser.com/questions/46441/rsync-as-a-background-process
    – Lynob
    Sep 9, 2013 at 15:37

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