LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-29-2008, 08:55 AM   #1
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Rep: Reputation: 16
Backup problem on fedora core 4 (mysql5(optional))


i am totally new to linux, i have been considering to get to it for a long time but now i have to use it at work as i was given the duty to setup an auto-backup of mysql 5 database everyday on the fedora core 4 pc at work. I have installed pardus and using it for 2 weeks though, so i dont want to go back to windows at no place(home - work -...)
So as i have mentioned i must setup auto-backup, mysql administrator is also installed on the pc. But i can't use the auto-backup option on the mysql administrator, i can't save the scheduled task. Well i can, but when i close it and re-open it the saved job is gone(the backup time remains but the destination and the prefix parts are empty) I read that the password encryption part, or something like that must be obscured(not plain text) but when i re-open it, it also changes back to plain text after saving and closing. So i cant do it using mysql administrator-dunno why, i guess something about permissions.
I have been searching for 2 weeks now, and i have tried several ways, i found a backup program for windows(karen's replicator) which works great on windows(and is made for it) but couldnot get wine to make it work on my pardus because it requires other programs such as vbasic 6.0 (not sure it will work if i use wine to install-use vbasic 6.0 as well). BTW i must do the backup thing on a server machine so i cant risk to try risky things that i dont know how will end.
Then i read about amanda but could not install it, first i did not know how to install but then i learned how to, and could not do it because of the dependencies.ANOTHER BTW: I CANT CONNECT TO THE INTERNET ON THE SERVER MACHINE (where i must do the backup-to remind-)
Later i learned about rdiff backup and tried it on the laptop with pardus from which i m writing right now,and it worked!! First backup on a linux system : ) but could not install rdiff on the fedora core 4 because of the dependencies; "libc.so.6(GLIBC_2.4)" , "librsync.so.1(one or the letter L(not sure-one i guess))" , "pylibacl(rdiff was made using python)" , "pyxattr" and rtld(GNU_HASH)
so I've been trying to find these and considering to download and copy to a flash and copy them to the lib directory on the fedora. Dunno if it will work but i couldnot find these so i have finally given up and become a member of linuxquestions.org to ask as well as the fedoraforum.org

SO CAN U HELP ME?

Last edited by caksin; 07-29-2008 at 09:09 AM.
 
Old 07-29-2008, 09:02 AM   #2
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
it is also okay if i can backup the folder containing the mysql database, that's why i wrote about other backup programs.
To make it clear, i have a laptop with pardus, i must do the job on a server machine at work with fedora core 4 with no internet connection and i cant risk anything there as it is a very important server.
 
Old 07-29-2008, 06:01 PM   #3
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189

Rep: Reputation: 105Reputation: 105
Well, I understand it can be frustrating when you are just getting into Unix/Linux and have to learn it while taking on responsibilities at the same time. It's not going to be easy, but you just keep plugging.

If you are specifically wanting to backup MySQL, what you want is Zmanda Recovery Manager (ZRM) for MySQL. You will find links here: http://www.linuxquestions.org/bookmarks/tags/backup -- it's about 2/3 of the way down that page.
 
Old 07-29-2008, 06:39 PM   #4
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
What directory are you trying to back up? where do you want it backed up to? how often do you need it to backup? personaly I like to do all my backups with tar. mainly because it's already installed on anything even remotely 'ix ish. you can just use tar to create a tar.gz backup (kind of like a zip file) of the directory you are trying to back up and you can use tar to restore. if you need it to be automated just make it a cron job. best part about doing it this way is everything you need will already be on the computer at work and your laptop.
 
1 members found this post helpful.
Old 07-29-2008, 09:19 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Depends a bit on your recovery strategy, but a basic soln would be to take a copy of the mysql.cnf file and use the mysqldump tool (part of the mysql install usually) to save the data.
http://dev.mysql.com/doc/refman/5.0/...-recovery.html

If you've got one main DB (aka schema) then you can get it to dump everything to one file.
Otherwise, dump each schema to a separate file then tar and gzip them together, if the result is not too big:

tar czf total_dump.tgz db1.dmp db2.dmp db3.dmp etc

If the result is too large to handle easily, just compress (gzip the individual files):

gzip *.dmp
 
Old 07-30-2008, 02:39 AM   #6
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
i am trying to backup a folder in the var/lib/mysql/ thats where they told me to backup before trying something so that if i do something wrong, we wont loose the data. The backup is to be everyday. If i can do it i will try to do it by adding to jobs; one for everyday backup and another one to the backup each month or 3 weeks, so that we can go back to that when something's wrong and is backed up daily. I want to back it up to a folder on the desktop.
I forgot to mention that i tried to use amanda as well, it also requires some files and i cant use it either, in fact i am afraid to try any installations that may replace smthing, eventhough i am not sure it will replace anything.
I think the tar backup thing would be easiest for me. I saw about the cron jobs before while searching for a solution. Are they ready to use in the fedora core 4 - built in? Can u tell me how to do it as well? Both the autobackup and the restore with tar and the cron job?
 
Old 07-30-2008, 03:02 AM   #7
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
I was just told that i should do the backup to a usb or someting. the server is always on, so i can just plug in a 8gb usb flash disk. I was also told that i should also backup (auto) some files from the windows machines in the network. There are about 10 pc s here with windows and the server is linux, server can see the windows machines in the network but windows machines cant see the server(if they could i would have done it the first day with karen's replicator. Can i use the tar and cron job to do the backup from the windows machines as well?
 
Old 07-30-2008, 03:13 AM   #8
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
By the way I want to thank you all for taking the time to read think and reply. I believe windows has little time remaining for freedom shall rule the worlds of the minds and the bodies
 
Old 07-30-2008, 08:46 AM   #9
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
Okay i think i have learned about how to do it using tar+cron thank u all. I just started reading about these and don't know exactly how to do it if can't manage to complete the auto-backup i ll ask it here again. Thank you all again.
 
Old 07-30-2008, 11:23 AM   #10
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
If it were me this is the command I'd use to make the backup with tar:
Code:
 tar cvzpf /path/to/backup/mysql_backup_`date +%b-%d-%Y`.tar.gz /var/lib/mysql/
The options mean:

c = create
v = verbose
z = gzip the tar file
p = preserve the user permissions
f = file

This will automatically create a .tar.gz file in the folder /path/to/backup/ with a name like:

mysql_backup_Jul-30-2008.tar.gz

this would be good for automating with cron because you can run that command every day and it won't overwrite the old backups because the filename will have the date in it.

you could also set up a udev rule so that all you have to do is plug in your 8Gb thumb drive and it will backup to the thumb drive automatically.

as for backing up the data from the windows boxes how does the linux box 'see' them are they mounted to the filesystem or something?

Last edited by johnson_steve; 07-30-2008 at 11:26 AM.
 
Old 07-30-2008, 09:48 PM   #11
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
The point of mysqldump is that it locks the tables (briefly) so you get a consistent data view. A straight tar as above will not produce a clean backup of the DB contents, unless you shutdown the DB first.
 
Old 07-30-2008, 10:52 PM   #12
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Quote:
Originally Posted by chrism01 View Post
The point of mysqldump is that it locks the tables (briefly) so you get a consistent data view. A straight tar as above will not produce a clean backup of the DB contents, unless you shutdown the DB first.
Ahh. I think your right. I didn't have mysql running at the time I tested this.
 
Old 07-31-2008, 07:27 AM   #13
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by chrism01 View Post
The point of mysqldump is that it locks the tables (briefly) so you get a consistent data view. A straight tar as above will not produce a clean backup of the DB contents, unless you shutdown the DB first.
I also thank you for that. It is useful indeed, and i agree with my friend who talked about responsibilities.
here is what i tried to use :
"30 18 * * * root cd /home/penguen1/yedekleme/rdiff;tar -cvf - * | tar -C /home/penguen1/yedekleme/cron/ -xv"
This is to run the job every(day of (month+week)+month) stated using "*" first "30" is the minute and obviously "18" is the hour of day.
as a cron job by using crontab -e to create a new job or edit one dunno which one if there 2<. (-l is to list -r is to delete(for the ones like me))
Do you think there is anything wrong with it? and do you know of a way how to turn mysql off automatically before the copy and start automatically afterwards considering the above knowledge.

Last edited by caksin; 07-31-2008 at 07:31 AM.
 
Old 07-31-2008, 08:07 AM   #14
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
Btw would it be no problem using mysqldump while mysql server is running? I do realize mysql_dump is more like made for the job and if its okay to use it while the server is on i think i should use it. I was very close to using tar, but i never considered what chrism01 talked about. So i think i had better start reading about it. Thnx a lot chrism01.
 
Old 07-31-2008, 09:24 AM   #15
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Original Poster
Rep: Reputation: 16
chrism01 can u tell me shortly what the conditions to be able to do the auto-backup are?
I cant seem to make much progress. By conditions i mean: must i be the root? Does not linux block you to move or copy files without being root? Is the -p option enough after choosing root for -u to be able to do the backup with the mysqldump?

mysqldump ---user [user name] ---password=[password]
[database name] > [dump file]

So is this enough?
like mysqldump -u root -ppassword(i read somewhere that -p and the password should have no empty space inbetween-correct?) some_db_name > backedupfile.sql (must i write ".sql"?)
 
  


Reply

Tags
backup, database, fedora, mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
APCUPS backup - Fedora Core 6 bskrakes Linux - General 8 08-08-2007 12:05 PM
Tape backup on Fedora Core 5 triley Linux - General 6 08-17-2006 02:21 PM
Adding optional components to Fedora Core 5 from CD-Rom or CD-Images MRMadhav Linux - Software 6 04-23-2006 12:04 AM
Backup for Fedora Core 3? lennysokol Linux - General 5 02-26-2005 07:28 PM
backup via Win2K from Fedora Core 2 rporter1980 Fedora 0 06-19-2004 05:54 AM


All times are GMT -5. The time now is 09:02 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration