RE: [PHP-DB] db backup / copy
| From: | Gurhan Ozen | Date: | Mon, 11 Feb 2002 20:41:44 +0000 |
| Subject: | RE: [PHP-DB] db backup / copy | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16823@lists.php.net to get a copy of this message | ||
I think Marc is looking a way to tranfer backup files between servers?
For that purpose he can use PHP's ftp functions..
Here is the detailed info about PHP's FTP functions...
http://www.php.net/manual/en/ref.ftp.php
Or you can also use a shell script for the same purpose...
Here is an FTP script..
-----------------------------------------------------
#!bin/ksh
FTP_USERID=username
FTP_USERPW=password
FTP_HOST=hostname
FTP_LOG=logfilepathandname
ftp -inv $FTP_HOST <<-FTP_CONNECTION >| $FTP_LOG #2>&1
user $FTP_USERID $FTP_USERPW
prompt off
cd bin
mput $1*
bye
FTP_CONNECTION
------------------------------------------------------
Of course you can customize this script to fit your needs, and to ftp only
the files you want to FTP etc. If you use this script make sure to chmod it
to 700 so that noone else can see it because it stores your user name and
password in plain text.
Hope this helps.
Gurhan
-----Original Message-----
From: Rick Emery [mailto:remery@excel.com]
Sent: Monday, February 11, 2002 3:12 PM
To: 'marc@chescolawyers.com'
Cc: 'php-db@lists.php.net'
Subject: RE: [PHP-DB] db backup / copy
yes, you can run a php script from cron.
You might run a shell script which executes mysqldump on the database.
Then, tacks on a database "use" statement to the beginning of the file.
Then, executes mysql on the other server while re-directing the file as
standard input (stdin)
-----Original Message-----
From: Marc S. Bragg [mailto:marc@chescolawyers.com]
Sent: Monday, February 11, 2002 2:06 PM
To: Rick Emery
Subject: Re: [PHP-DB] db backup / copy
Would prefer an automated solution if there is one. Maybe run a php script
as
part of a cron job? Is that possible.?
Rick Emery wrote:
> If you don't need an automated solution, then the mysqldump application
will
> work for you. (I assume you are using mysql)
>
> -----Original Message-----
> From: Marc S. Bragg [mailto:marc@chescolawyers.com]
> Sent: Monday, February 11, 2002 1:55 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] db backup / copy
>
> Hi,
>
> Anyone have any working scripts for tracking backups and files backed up
> from server to server?
>
> --
> Marc S. Bragg
> marc@chescolawyers.com
> Bialecki & Bragg, PC
> p: 610-444-7508
> f: 610-444-7548
>
> http://www.chescolawyers.com/BB
> "Legal Directory, Services & Consumer Information for Chester County"
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Marc S. Bragg
marc@chescolawyers.com
Bialecki & Bragg, PC
p: 610-444-7508
f: 610-444-7548
http://www.chescolawyers.com/BB
"Legal Directory, Services & Consumer Information for Chester County"
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php