Existing users, log in.  New users, create a free account.  Lost password?

Mac OS X  |  IT & Network Administration  |  Other Network / Admin  |  MySQL BackUp  |  brain freeze

MySQL BackUp

MySQL BackUp

back up MySQL databases

Version:  1.1

   [ Views: 424 ]

brain freeze

Feedback Type:  Usage Tip

Contributed by: grikdog Wednesday, March 24 2004 @ 11:49 AM PST

Product Platform: MacOSX

Used Product For: Have Not Tried

Recommend Product: NO

# Terminal is used for testing scripts that you intend to run using cron.  Script it,
# crontab it, forget it.  Done once, done right (enough), repeats at intervals forever.

#!/bin/sh

if [ ! -e /Users/me/Desktop/mysql_backup.sql.bz2 ]
then
	if /usr/local/mysql/bin/mysqladmin --user=me --password=xxxxxxxx refresh
	then
		if /usr/local/mysql/bin/mysqldump --opt --all-databases --user=me --password=xxxxxxxx >/tmp/mysql_backup.sql
		then
			if /sw/bin/bzip2 /tmp/mysql_backup.sql
			then
				if mv /tmp/mysql_backup.sql.bz2 /Users/me/Desktop
				then
					chown me:admin /Users/me/Desktop/mysql_backup.sql.bz2
				fi
			fi
		fi
	fi
fi

  

1 of 2 users found this helpful.

Rate this Usage Tip

Was this Usage Tip helpful? Yes | No

Comments

0 comments |

No user comments.