Σελιδοδείκτης, μερίδιο, και λυκίσκος οι αγαπημένες περιοχές σας με τη ράβδο εργαλείων SiteHoppin για Firefox!

Πλάτη: 1/2 του UK. Τα άτομα θα σταματούσαν το φύλο για μια TV;!;

Διαβιβάστε: Αυτό που είναι Soju και πώς αυτό έχει επιπτώσεις στη ζωή ενός (αβ) χρήστη Entrecard


ΑΜΥΧΉ κεντρικών υπολογιστών δικτύου DIY Linux - αυτοματοποιήστε τα στηρίγματα βάσεων δεδομένων MySQL σας MySQL

Ταχυδρομημένος μέσα Blog, Δροσίστε, DIY Zedomax, DoItYourself!, Εκπαιδευτικός, Αμυχή, Linux, Ubuntu, Ιστός, Wordpress από ανώτατο στις 10η Φεβρουαρίου 2008 στις 5:24 μ.μ.

Εντάξει, έχω τρέξει τους αφιερωμένους κεντρικούς υπολογιστές για τα έτη ζευγών τώρα και χρησιμοποίησα για να βρωμίσω γύρω με τα κιβώτια Linux πίσω στο κολλέγιο.

Εδώ είναι ένα ουσιαστικό αυτόματο χειρόγραφο και μια εργασία cron που θα χρειαστείτε προκειμένου να κρατηθεί το στήριγμά σας αυτόματο.

Ναι, εάν παίρνετε έναν αφιερωμένο κεντρικό υπολογιστή, μην πάρτε ηλίθιο πρόσθετο $15/month τους για την υποστήριξη της βάσης δεδομένων σας.  (Το μόνο που κάνουν είναι κάνει τα χειρόγραφα όπως αυτό και σας χρεώνει για το)

Μπορείτε να ακολουθήσετε αυτό το παράδειγμα και να πάτε ξοδεύετε εκείνα τα χρήματα στα τρόφιμα παλιοπραγμάτων.

Έτσι όλο που πρέπει να κάνετε είναι FTP τα εφεδρικά αρχεία σας.

Αυτό είναι τρόπος καλύτερα από πηγαίνοντας στο phpMyAdmin σας και μεταφορτώνοντας από τη διεπαφή Ιστού δεδομένου ότι το αρχείο είναι ήδη έτοιμο για σας να μεταφορτώσει.

Εδώ είναι πώς εσείς το κάνει:

1) Make a new file called backup.sh in your home directory. 2) Use the following syntax:

mysqldump -u[USERNAME] -p[PASSWORD] –opt [DATABASE NAME] > /root/backup/DATABASE1.sql

Here’s an example backup.sh file if you had 2 databases:

mysqldump -uUser1 -pPassword1 --opt Database1 > /root/backup/Database1.sql
mysqldump -uUser2 -pPassword2 --opt Database2 > /root/backup/Database2.sql
tar cvf /root/backup/sqlbackup.tar /root/backup/*

You can test your script by typing this:

sh backup.sh

(The mysqldump will overwrite the older file if you run this more than once)

3) If everything is working good, now you can put that script to be run once a day in your cron job.

For Fedora Core, you can edit this file /etc/cron.d/sa-update

Add the following line:

10 3 * * * root sh /root/backup/backup.sh

This will execute the script once a day at 3:10AM.

Now simply download one tar ball file whenever you feel like backing up your database.

You can probably change this a little bit and use it for many other things like backing up all your files too. (which I do)

If you have multiple servers like me, you can also automate your scripts to download backup databases to each server. That keeps things real redundant in case of server failure.

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,



1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


If you like this post then please subscribe to my full feed RSS. You can also subscribe by Email.

Got a new hack, DIY, howto, or gadget? Tip us here.

Search for a Hack:


Bookmark It!


|Digg it |SiteHoppin |Wagg It |

Related Posts



TrackBack

Email this to a Friend Email This Post Email This Post

RSS feed

5 Comments »

Comment by Mike
2008-02-11 02:24:34

Very useful script. Thanks.

http://packratstudios.com

MyAvatars 0.2
Comment by max
2008-02-11 07:15:11

glad it helped!

MyAvatars 0.2
Comment by Brian Gaut Subscribed to comments via email
2008-02-11 05:22:04

To further automate the process of backing up, you should set up a LOCAL cron job that downloads the file to your computer.

Which is just as easy…. all ya do fetch the remote file:

wget ftp://Username:Password@www.yoursite.com/backup/sqlbackup.tar

MyAvatars 0.2
Comment by max
2008-02-11 07:14:54

true, that’s if you are using Linux…wait a minute, why am i not using linux!?!

MyAvatars 0.2
Comment by Craig Beckta Subscribed to comments via email
2008-06-05 16:10:43

Cool script.

I’ve always used a software product to backup my DBs - it was something like database backup generator.

You set it to run daily and it’ll back up, email you a download link, and also store as many backups as you need.

The thing I liked was that you could restore the DB with one click from the admin panel.

Craig

MyAvatars 0.2
Name (required)
E-mail (required - never shown publicly)
URI

Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.