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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-24-2007, 10:18 AM   #1
Juicy D. Links
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
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:25 AM   #2
bns666
Confirmed Fetishist
 
bns666's Avatar
 
Industry Role:
Join Date: Mar 2005
Location: Fetishland
Posts: 11,527
bump i need this tooooooooooo.
__________________
CAM SODASTRIPCHAT
CHATURBATEX LOVE CAM
bns666 is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:34 AM   #3
psili
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.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:34 AM   #4
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
Quote:
Originally Posted by bns666 View Post
bump i need this tooooooooooo.
i am googling now , se if i can find something
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:35 AM   #5
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
Quote:
Originally Posted by psili View Post
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
hmm that looks ripe. i try it
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:40 AM   #6
the alchemist
Confirmed User
 
the alchemist's Avatar
 
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
the alchemist is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 10:41 AM   #7
directfiesta
Too lazy to set a custom title
 
directfiesta's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Montreal, Quebec
Posts: 29,680
http://www.debianhelp.co.uk/mysqlscript.htm
__________________
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 ....
directfiesta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:21 AM   #8
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
niceeeeeeeeeeeee
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:35 AM   #9
SuckOnThis
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
SuckOnThis is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:37 AM   #10
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
Quote:
Originally Posted by SuckOnThis View Post
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
thats niceeee save as a .sh file and execute via SSH right?
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:38 AM   #11
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
What's this about my Ass Queue? I'm not very good with computars.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:54 AM   #12
SuckOnThis
So Fucking Banned
 
Join Date: Oct 2003
Location: In my head
Posts: 6,844
Quote:
Originally Posted by Juicy D. Links View Post
thats niceeee save as a .sh file and execute via SSH right?
You can execute it with SSH or run it as a cron.

Just be sure to enter the correct info for 'databases', 'backupdir', 'user', and 'password'
SuckOnThis is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:55 AM   #13
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
script above is rippeee works hotttttt thxxxx
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 11:57 AM   #14
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992

Quote:
Originally Posted by SuckOnThis View Post
You can execute it with SSH or run it as a cron.

Just be sure to enter the correct info for 'databases', 'backupdir', 'user', and 'password'

yup did that

thxxxxxxxxxxxxx
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 12:00 PM   #15
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
Dump Successful and Complete!
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 01:22 PM   #16
HomerSimpson
Too lazy to set a custom title
 
HomerSimpson's Avatar
 
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:
HomerSimpson is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 03:41 PM   #17
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Quote:
Originally Posted by SuckOnThis View Post
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.
Sweet script...

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.
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 03:49 PM   #18
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Tempest View Post
Sweet script...

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.
Why the hell did you use Perl?

Code:
-rwx------ 1 root root 3426 2007-09-29 13:16 backer.sh
This little 3.5k shell script does daily, weekly, monthly, and yearly backups, compresses them all, and keeps any amount of 'snapshots' you want, and offers automated redundancy with rsync and ncftpput.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 04:26 PM   #19
bDok
Confirmed User
 
bDok's Avatar
 
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.
__________________
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Warriors come out to plaAAaayyy!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
bDok is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 04:42 PM   #20
Juicy D. Links
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
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 04:43 PM   #21
Juicy D. Links
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
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 04:43 PM   #22
Juicy D. Links
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
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 04:52 PM   #23
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Quote:
Originally Posted by GrouchyAdmin View Post
Why the hell did you use Perl?

Code:
-rwx------ 1 root root 3426 2007-09-29 13:16 backer.sh
This little 3.5k shell script does daily, weekly, monthly, and yearly backups, compresses them all, and keeps any amount of 'snapshots' you want, and offers automated redundancy with rsync and ncftpput.
ha ha ha.. why? Cause I know perl and do a LOT of little scripts with it so it's just second nature to me... I know very little about what's already available on most servers/OSs.. and I'm not great writing cross-OS shell scripts.

Couldn't find backer.sh on one of my FreeBSD and Linux servers.
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 05:46 PM   #24
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Tempest View Post
Couldn't find backer.sh on one of my FreeBSD and Linux servers.
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.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 05:52 PM   #25
papill0n
Unregistered Abuser
 
Industry Role:
Join Date: Oct 2007
Posts: 15,547
Quote:
Originally Posted by SuckOnThis View Post
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
very useful - thanks alot for posting that
papill0n is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 07:51 PM   #26
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
i make great threads
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 07:52 PM   #27
Az A Bay Bay
Confirmed User
 
Join Date: Sep 2007
Posts: 1,129
soRRy cant HELP "(
__________________

Home of Ed Powers and america's next hot pornstar
Az A Bay Bay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2007, 07:54 PM   #28
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Juicy D. Links View Post
i make great threads
Show me one.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.