Click to See Complete Forum and Search --> : use of wget?
latenite
12-24-2008, 07:45 AM
Hi everybody
I realy need help making a backup.
I am using linux (debian) for developement and in general i prefere the commandlinetools.
So I tried to copy EVERYTHING from the server where my domain is at with the help a wget.
I read the manpage an uses all kind of flags (-m, -r, -c --timeout and so on...) but had no luck getting all files from the server.
Sometimes the download of a file (e.g a index.php) just stops in the middle of the file an will not retry (altough set as flag).
Sometimes wget just leaves files out so the mirroe is not complete.
All kind of mistakes...but never an entire download of the files on the server.
I do not have ssh access but ONLY ftp via (admin) user & password.
Now my question is:
Which tool to use?... And how to use it to get an entire mirror of the directories and files on the server via ftp on commandline?
I would like to automate that with cron to make backups automated...
How do YOU do that? What tools do you use (what flags are set)?
I now curl, ftp, wget, httrack and so on...but but I did not get any of them to download the entire content (all files an direcories recursively).
Thank you for your help in advance.
:)
drhowarddrfine
12-24-2008, 03:19 PM
If none of those worked then you need to look elsewhere for the problem. If it's not your connection then you should at least put a problem ticket in with your host.
scragar
12-24-2008, 06:17 PM
Have you tried:
ftp
open FTP DOMAIN
.... -- enter username and password if asked for
mget .
!
Line by line explanation:
ftp start command line FTP
open FTP DOMAIN open a connection to the domain
mget . get the current folder, and all it's contents
! exit back to the shell
latenite
12-25-2008, 06:10 PM
no luck either..
01:06 kai@desktop ~ -> ftp
ftp> open berlindecor.de
Connected to berlindecor.de.
220 Speak friend, and enter
Name (berlindecor.de:kai): berlindecor.de
331 FTP login okay, send password.
Password:
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> mget .
mget .htaccess?
200 PORT command successful.
150 Opening BINARY mode data connection (416 bytes).
226 Transfer complete. Closing data connection.
416 bytes received in 0.00 secs (154.8 kB/s)
mget bd?
200 PORT command successful.
550 No such file.
mget cgi-bin?
200 PORT command successful.
550 No such file.
mget cgi-data?
200 PORT command successful.
550 No such file.
mget kw?
200 PORT command successful.
550 No such file.
mget pp?
200 PORT command successful.
550 No such file.
mget www?
200 PORT command successful.
550 No such file.
ftp>
ftp>
ftp>
ftp>
ftp>
ftp>
ftp>
ftp>
ftp> mget
(remote-files)
usage: mget remote-files
ftp> mget.
?Invalid command
ftp> mget .
mget .htaccess?
200 PORT command successful.
150 Opening BINARY mode data connection (416 bytes).
226 Transfer complete. Closing data connection.
416 bytes received in 0.00 secs (91.4 kB/s)
mget bd?
200 PORT command successful.
550 No such file.
mget cgi-bin?
200 PORT command successful.
550 No such file.
mget cgi-data?
200 PORT command successful.
550 No such file.
mget kw?
200 PORT command successful.
550 No such file.
mget pp?
200 PORT command successful.
550 No such file.
mget www?
200 PORT command successful.
550 No such file.
ftp>
ftp>
I tried it manually...
something allways stops...
I can#t really give you my login... :) but is there anyway to give somebody else a try?
thank you
scragar
12-25-2008, 07:08 PM
Could you put that in [code] tags, just for readabilities purposes?
I have no idea why that won't work for you, it always works perfectly fine for me.
By the looks of it though you have prompt on, just turn that off(it toggles, so enter prompt on the ftp line to toggle it).
drhowarddrfine
12-25-2008, 10:28 PM
What is the output of 'ls'?
latenite
12-27-2008, 07:58 PM
02:57 kai@desktop ~ -> ftp
ftp> open
(to) berlindecor.de
Connected to berlindecor.de.
220 Speak friend, and enter
Name (berlindecor.de:kai): berlindecor.de
331 FTP login okay, send password.
Password:
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection.
-rw-r----- 1 ftp ftp 416 Jul 22 16:44 .htaccess
drwxr-xr-x 14 ftp ftp 4096 Nov 12 2007 bd
drwxr-x--- 2 ftp ftp 4096 Jan 25 2007 cgi-bin
drwxr-xr-x 5 ftp ftp 4096 Feb 1 2007 cgi-data
drwxr-xr-x 9 ftp ftp 4096 Jul 22 16:46 kw
drwxr-xr-x 19 ftp ftp 4096 Nov 12 2007 pp
drwxr-xr-x 7 ftp ftp 4096 Dec 16 17:25 www
226 Transfer complete. Closing data connection.
ftp>
that s what ls sais.
I would love to use wget...but how?
drhowarddrfine
12-27-2008, 09:31 PM
All of those, except .htaccess, are directories, not files. That's why it's not been working.
latenite
12-28-2008, 04:55 AM
but I need files AND directoreis. so to say Everything!
Anyone around here who uses wget?
Doosn't anyone aroud here use a cronjob and ftp to backup their webspace?
Thank you so far...I still need some help thogh, since it s not working yet.
scragar
12-28-2008, 05:00 AM
wget -mN ftp://USERNAME:PASSWORD@URL
Will work great in a cron job(I use it for my server, but I really don't think you should use it, unless you make sure to archive the current downloaded files first, it has a tendency as well to not delete local copies of un-needed files, so be warned about that as well).
EDIT: 0h, and be sure to cd to the required dir first, you don't want it clogging up your home dir if you can help it.
drhowarddrfine
12-28-2008, 07:56 AM
Anyone around here who uses wget?
scagar and I both use wget so asking that while we are answering you is a little insulting.
Did you read the man pages? If you are trying to retrieve whole directories then you need to use the -r option for recursive retrieval. I don't recall if that works from outside the directory or not so you may need to change to the directory itself.
scragar
12-28-2008, 08:00 AM
scagar and I both use wget so asking that while we are answering you is a little insulting.
Did you read the man pages? If you are trying to retrieve whole directories then you need to use the -r option for recursive retrieval. I don't recall if that works from outside the directory or not so you may need to change to the directory itself.
My name has an extra r :p
And don't use -r for backups, use -m, mirror is much smarter than recursive for accessing FTP.