wget downloads empty database

swecs

Registered
Jan 1, 2007
2
0
151
Hi, just wondering if anyone has had the problem where you download a mySQL backup through cPanel and it works out fine, but if you try the same thing via WGET, it downloads an empty file?

The command line in WGET is fine (exactly the same as in cPanel), it downloads fine, no errors, but the downloaded file is always 20KB and empty. This is happening to me across all domains. Home directory backups working fine, this is only happening with databases.

If anyone has experienced the same I'd love to know what is causing it - driving me crazy!

Background: I'm trying to automate backups to my harddrive

Cheers
Graeme
 

bhd

Well-Known Member
Sep 20, 2003
149
2
166
JNB ZA
cPanel Access Level
Root Administrator
No sure if I understand you fully but here goes:

Firstly, you cannot simply wget a database. You have to use mysql to create the .sql file first (which is what Cpanel can do for you). Second, wget will not work on a file that does not have FTP or HTTP access (like /home/user/backup-dir) without the account password, user name and path because by definition, the .sql file is stored in an area that does not have direct web access without the account password etc.
 

swecs

Registered
Jan 1, 2007
2
0
151
thanks
sorry i can see my initial post wasn't very clear. other people are able to do this, either by using a command line like:

wget.exe http://user:[email protected]:2082/getsqlbackup/ccrt1.gz

or by using programs such as CP SiteSaver (which simply automate the command). Using that command will download the mysql backup, just the same way as if you clicked on the link in the Backup section of cPanel.

So I was just checking if there might be any reasons why I can't when others can, or if anyone else has encountered a similar problem

Cheers
Graeme
 

Nhojohl

Well-Known Member
Nov 28, 2006
100
0
166
If you have root access and shell you should be able to

# cp /path/to/backup.gz /path/you/want/to/save/to