Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file on my server that is changing constantly, it changes hourly, sometimes it changes every minute. The file is is growing, but not so fast.

This file is generated inside a dir called /home/my_user/backup123/subnets.cfg, until here no problem.

This is my first question: Now I need to put this file on a remote server. What is the best way to do this? From my local server, that where the file is located or across the remote server?

Here is my second question: If I do across the remote server I think I need to use the wget command right? I have tried to use this command:

 wget --user=my-user --password=password

But it is not working, it tells me "wrong user name". Of course I had use my own user name and password, but it is not working. I have permissions to the file and dir.

I need to get the subnets.cfg file and put it on my remote server, how can I do that?

share|improve this question
perheps I can use the wget inside the cron jobs, something like this -> 0 0 * * 0 wget --mirror -o /home/my_user/my_files/ But it is only the idea, firstly I need everything above working properly.. :) – B4NZ41 Apr 12 '11 at 15:32
make sure that user is the .htaccess user and password the .htaccess password. – omnidan Apr 12 '11 at 15:36
I do not have a .htaccess file in my server, nor local neither remote. – B4NZ41 Apr 12 '11 at 15:45
@Fernando Maybe it's hidden, if you really don't have a .htaccess file, remove the --user and --password args. – omnidan Apr 12 '11 at 15:46
but it is 2 linux server, all file is being showed to me.. I had tried without user and password .. I get the nothing.. I'm trying to connect as root and nothing.. I know is not the best way try to connect as root, but I'm testing.. if works I'll create a new user only to the task. – B4NZ41 Apr 12 '11 at 15:47
up vote 2 down vote accepted

If you want to download a file from a FTP server over wget, you have to type:

wget -t 10 -nH -P backup -r

Replace USER with your ftp username and PASSWORD with your ftp password.

I hope this helped you,


share|improve this answer
It works like a charm!! Thanks, that's it man! Your help was completly useful to me. – B4NZ41 Apr 12 '11 at 22:37

Your Answer


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.