The forum · September 2003 – July 2004 › NEWS
Need help again [SQL Question]
SQL Script Scheme to backup dayly
Started by Alle · 9 posts · 100 views · this thread in the Internet Archive
Alle14 Oct 2003, 05:11 Does anyone know how to create or where to get and how to install a script on the server that make a complete or selected backup of the Forum MySQL database on a daily basis!??
This seems highly needed and I'd really like some help with this as it's not really my primary area of work :blush:
Best,
AlexDavid McGowan14 Oct 2003, 06:19 If you know how to create the backup , then you would put the command in the cron tab, so that it will execute at certain intervals that you designate. I dont know anything really about SQL, but in linux your scheduler is called cron.
DavidAlle14 Oct 2003, 06:22 Ok, well I'm sorry to say that doesn't help me too much, don't know squat about SQL or Linux... :whistle:
Thanks though.
//Alexr2ci15 Oct 2003, 17:22 Make a simple shell script like:
#!/bin/sh
date=`date "+%Y-%m-%d"`
/usr/local/bin/mysqldump -u MYSQL_USER -pMYSQL_PASSWORD --opt --all-databases | bzip2 -c > /home/tc/databasebackup-$date.sql.bz2
Place it for example at /home/tc/ called backup.sh.
Then in crond configure this line:
(crond edit mode is started by entering crontab -e)
0 0 * * * /home/tc/backup.sh
BTW, you need to chmod backup.sh to execute permissions.Alle15 Oct 2003, 17:52 I have no clue on what you're talking about :)
I don't have any other access to my db then through phpmyadmin and via dreamweaver... Is there a way for me to configure something with the help of this?
If not - I just installed a database hack upgrade for the forum that enables me to dump larger databases without stupid timeout errors as well as restoring them in a very easy way...
Best,
//AlexDavid McGowan15 Oct 2003, 18:21 yeah you need shell access to the server, either via telnet or ssh. you prolly have the access but didnt know about it.
download putty , put in the hostname , fto username and password. use ssh port 22, and it should connect you to the server...Its kinda hard to describe if youve never worked in the shell before tho.
David :unsure:djdarkshade16 Oct 2003, 00:04 I bet my bro know's how. I'll ask him when he gets home.Alle16 Oct 2003, 01:56 Hmmm... did work with SSH before - annoying if you ask me - but sure if it works to connect via SSH, then I do have shell access indeed - let me try this out and get back to you.
Best,
Alexteknodave22 Nov 2003, 23:32 If you still need help in this department, I can check with my lil bro too. He *might* know.
I will comb through my scripts to see if I can get mine doing that...if I can get the dumb thing working again. :whistle: