PDA

View Full Version : Database Dumps


IlyaZ
1-18-05, 12:35 PM
Hello,

my database dumps have recently been 0.3kb big. They are normally around 3500 kb in size. And the database is still containing much information, site works well etc. Very strange. However, how do I make a back-up of my database now?

B&T
1-18-05, 12:55 PM
However, how do I make a back-up of my database now?Use this script:
http://prettyworthless.com/tips.php?tip=sql_backups#tip

IlyaZ
1-18-05, 02:07 PM
Thanks but what is Cron? And is this script secure?

B&T
1-18-05, 02:17 PM
Thanks but what is Cron? And is this script secure?
Cron is a unix scheduler. Read this:
http://prettyworthless.com/tips.php?tip=cron_basics#tip

For security - make sure the script is above htdocs - cron can access it there - but not http. And it would be best to set up a mysql user with only lock and select rights to put in this script to do the backup - just in case someone else on your shared server is poking around. But yes, it is as secure as anything else on your shared server.

IlyaZ
1-18-05, 05:02 PM
"$filename="/www/X/XXXXXX/backup$day.sql";"
This line, what is the dir X resp. XXXXXX? (I see no www either but I assume it's my root?) And won't other people be able to download it? It creates a copy and puts it on the server? Where do I put this script?

B&T
1-18-05, 08:57 PM
"$filename="/www/X/XXXXXX/backup$day.sql";"
This line, what is the dir X resp. XXXXXX? (I see no www either but I assume it's my root?) And won't other people be able to download it? It creates a copy and puts it on the server? Where do I put this script?
Yes it is your document root.

I amswered the security questions in the post above yours. If you have any more, please ask. But the short form is no one can get to the script with http if you put it above htdocs.

Yes it puts the date named copy on the server. It is then up to you to ftp where you want to keep off-server backups (all 30 of them should be kept).

kanwulf
1-19-05, 10:28 AM
Those .3Kb database dumps are all empty. No data...

It's kind of hard to backup a dbase with no data. ;)

IlyaZ
1-19-05, 11:49 AM
Ok I see, but how do I put something above the htdocs?

mitchind
1-19-05, 12:00 PM
Use ftp and change directory to the parent directory just "above" htdocs