Backing up htdocs an mysql

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Backing up htdocs an mysql

Postby Repute Online Media » 13. November 2003 19:53

Hi ther foulks,

How can I manage that my /htdocs and al Mysql databases are backtup to /opt/lampp/backup or an other harddrive?

Any ideas?

Thnx,

Repute
Image
User avatar
Repute Online Media
 
Posts: 10
Joined: 12. November 2003 14:28

Postby Kristian Marcroft » 13. November 2003 22:13

Hi,...

with a Shell/Bash Script in a cronjob...

for mySQL this would look like:
Code: Select all
#!/bin/sh
mysqldump -u root --password=[rootpass] --opt --all-databases > backup.sql
echo "mySQL Backup completed"


to backup your htdocs I would use a tar command...

So long
KriS
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby Hansi » 14. November 2003 18:53

hmm, bei mir kommt immer

/var/backup/backup: mysqldump: command not found

bitte um hilfe :(
Hansi
 

Postby Kristian Marcroft » 14. November 2003 19:03

Hi,

please try

/opt/lampp/bin/mysqldump


So long
KriS
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby Hansi » 14. November 2003 22:58

WoW es funktioniert, thx!! ;)

Aber jetzt noch eine frage, wie importier ich diesen dump? also ich weiss wie man tabellen in eine datenbank mit phpmyadmin importiert, aber wie mach ich das mit 5 datenbanken?
Hansi
 

Postby Kristian Marcroft » 15. November 2003 07:25

Hi Hansi,

just for the Records, this is the english part of the Forum.
Please stick to the english... otherwise we wouldn't need it.

Back to your question....
How to restore...
http://faq.kwm-web.info/index.php?sid=6 ... 49&lang=de

Please also be carefull here, that "mysql" won't work, you need "/opt/lampp/bin/mysql"

So long
KriS
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby Shoukri » 15. November 2003 13:38

in this thread ( http://community.apachefriends.org/f/viewtopic.php?t=3094 ) was a backupscript posted (i hate my english *g*)

Code: Select all
#! /bin/sh

#Date etc. 
DATUM=`date '+%Y-%m-%d'`

echo "BackUp script Starting...."

mkdir /backup
cd /backup

tar zcvf backup_root_${DATUM}.tar.gz /root
tar zcvf backup_mysql_${DATUM}.tar.gz /opt/lampp/var/mysql
tar zcvf backup_log_${DATUM}.tar.gz /opt/lampp/logs
tar zcvf backup_homeusr_${DATUM}.tar.gz /home/
tar zcvf backup_etc_${DATUM}.tar.gz /opt/lampp/etc

echo "Backup Data created...!"
echo "BackUp Data transfering..."

cd /backup

ftp -in <<EOF
open <IP OF YOUR FTP SERVER>
user USERNAME PASSWORD
bin
hash
prompt
cd html
put backup_root_${DATUM}.tar.gz
put backup_mysql_${DATUM}.tar.gz
put backup_log_${DATUM}.tar.gz
put backup_homeusr_${DATUM}.tar.gz
put backup_etc_${DATUM}.tar.gz
QUIT
EOF

rm -rf /backup

echo "Finish!"

exit 0
User avatar
Shoukri
 
Posts: 76
Joined: 29. October 2003 00:25


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests