On Fri, 23 Mar 2001, Mike Noyes wrote:
> Mike Noyes, 2001-03-22 07:29 -0800
> >As soon as I figure out the correct sed syntax for stripping admin and
> >user passwords from our MySQL database, I'll make backups of our website
> >public.
>
> Everyone,
> Here is a rough draft of a function I wrote for striping the user and
> admin information from our database prior to archiving. Please review it.
> Thanks.
>
> get_db() {
> HOST=mysql.sourceforge.net
> DB=leaf
> USER=leaf
> umask 077
> mysqldump -h "$HOST" -u "$USER" -p --opt "$DB" > dbase/"$DB".sql
> sed -e '/LOCK TABLES users WRITE/,/UNLOCK TABLES;/d' dbase/leaf.sql | \
... omits all user(name?) data?
... hardcoded "leaf" vs $DB? maybe better to just pipe directly into sed
commands to avoid having unnecessary copies of the database that include
the unaltered author data?
> sed -e "s%INSERT INTO authors VALUES.*%INSERT INTO authors VALUES
> ('admin','ESS
> Admin','http://www.yourdomain.org','[EMAIL PROTECTED]','phpwebsite',
> 63);%" > test.sql
> }
this seems odd... if there are more entries in the authors table than just
admin, they will be reduced to just admin (with a bunch of failed
duplicate inserts)
is it really a good idea to lose author attribution? are there any foreign
keys depending on entries in this table? maybe better just to "fix" their
password to a dummy in the copy? I am not familiar with the schema, so I
don't know what else might be a problem, but whatever you do, try it and
load it into a temporary partition to verify that it works rather than
depending solely on eyeball review...
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<[EMAIL PROTECTED]> Basics: ##.#. ##.#. Live Go...
Work:<[EMAIL PROTECTED]> Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...2k
---------------------------------------------------------------------------
_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel