![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
MySQL automatic backup script I can run??
Anybody have a good one i can execute via the shell and also option to run daily via cron?
Ice is gay |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed Fetishist
Industry Role:
Join Date: Mar 2005
Location: Fetishland
Posts: 11,527
|
bump i need this tooooooooooo.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Not sure about InnoDB tables, but can't you put the following in a shell script:
mysqldump --user=[user] --pass=[pass] --opt [database] > /path/to/backup.sql
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Montreal, Canada
Posts: 3,271
|
To back-up all db's:
mysqldump --all-databases > all_databases.sql
__________________
264 349 400 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Too lazy to set a custom title
Industry Role:
Join Date: Oct 2002
Location: Montreal, Quebec
Posts: 29,680
|
__________________
I know that Asspimple is stoopid ... As he says, it is a FACT ! But I can't figure out how he can breathe or type , at the same time .... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
niceeeeeeeeeeeee
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
So Fucking Banned
Join Date: Oct 2003
Location: In my head
Posts: 6,844
|
Here Juicy, this works fine. You can even have it email you the dump file if you want or just have it saved on the server.
#!/bin/sh # List all of the MySQL databases that you want to backup in here, # each seperated by a space databases="name of database" # Directory where you want the backup files to be placed backupdir=/path/to/directory # MySQL dump command, use the full path name here mysqldumpcmd=/usr/bin/mysqldump # MySQL Username and password userpassword=" --user=username --password=your password" # MySQL dump options dumpoptions=" --quick --add-drop-table --add-locks --extended-insert --lock-tables" # Unix Commands gzip=/bin/gzip uuencode=/usr/bin/uuencode mail=/usr/sbin/sendmail # Send Backup? Would you like the backup emailed to you? # Set to "y" if you do sendbackup="n" subject="Your MySQL Backup" mailto="[email protected]" # Create our backup directory if not already there mkdir -p ${backupdir} if [ ! -d ${backupdir} ] then echo "Not a directory: ${backupdir}" exit 1 fi # Dump all of our databases echo "Dumping MySQL Database" for database in $databases do $mysqldumpcmd $userpassword $dumpoptions $database > ${backupdir}/${database}.dump done # Compress all of our backup files echo "Compressing Dump File" for database in $databases do rm -f ${backupdir}/${database}.dump.gz $gzip ${backupdir}/${database}.dump done # Send the backups via email if [ $sendbackup = "y" ] then for database in $databases do $uuencode ${backupdir}/${database}.dump.gz > ${backupdir}/${database}.dump.gz.uu $mail -s "$subject : $database" $mailto < ${backupdir}/${database}.dump.gz.uu done fi # And we're done ls -l ${backupdir} echo "Dump Successful and Complete!" exit |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
What's this about my Ass Queue? I'm not very good with computars.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
So Fucking Banned
Join Date: Oct 2003
Location: In my head
Posts: 6,844
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
script above is rippeee works hotttttt thxxxx
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
Dump Successful and Complete!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2005
Location: Springfield
Posts: 13,826
|
I could write you a custom one ;)
__________________
Make a bank with Chaturbate - the best selling webcam program ![]() ![]() ![]() Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!! PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email: ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
Quote:
I have one I wrote in Perl that also tars all the DBs together and then Zips it. They get saved with a datestamp as well so I can roll back a few days if need be. At some point I'm going to upgrade it to also FTP the DB backup to another server so if one goes down I still have backups. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
Quote:
Code:
-rwx------ 1 root root 3426 2007-09-29 13:16 backer.sh ![]()
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Join Date: Feb 2005
Location: SD/OC/LA
Posts: 1,917
|
nice shell script above.. perfect for making a gmail account for the database and shipping it off to that account daily or whenever you want to run it from the cron.
quality reply there. cheers.
__________________
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ![]() ![]() =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
all this code talk is getting me HARD
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
all this code talk is getting me HARD
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
all this code talk is getting me HARD
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
Quote:
Couldn't find backer.sh on one of my FreeBSD and Linux servers. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
That would be because I made it.
![]() ![]() If you always design for the least common amount of bourne compatibility, the shells will usually work. Don't rely on linux or BSD nuances by themselves, test if you have to, and abusing awk is never wrong. ![]()
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Unregistered Abuser
Industry Role:
Join Date: Oct 2007
Posts: 15,547
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
i make great threads
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 |
Confirmed User
Join Date: Sep 2007
Posts: 1,129
|
soRRy cant HELP "(
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |