REGISTER
|
Search Tycoon Talk
|
Freelancer.com
|
Members
Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.
Register Here
Forum Rules
PHP Forum
You are currently viewing our PHP Forum as a guest. Please
register
to participate.
Login
Remember Me?
Login via Freelancer.com
Tycoon Talk
>
Web Development and Programming Support
>
PHP Forum
>
how to create auto back up function
Link Back
Thread Tools
Search this Thread
how to create auto back up function
03-07-2010, 09:40 AM
#
1
(
permalink
)
how to create auto back up function
hno2005
Novice Talker
Posts: 6
Trades:
0
Talkupation:
HI
I want a function or a script that it makes back up from my data base daily
I have tried some scripts but they weren't work .
how can I do so ?
thanks
Register
now for full access!
03-07-2010, 10:19 AM
#
2
(
permalink
)
Re: how to create auto back up function
lynxus
Awesomeo-Maximo
Latest Blog Post:
IMsupporting Foresight ( Sneak peek ) – Live...
Posts: 1,618
Location: UK
Trades:
1
Talkupation:
if you have linux, You can use this with ftpput.
Create a file called backup in /usr/local/scripts/
Insert this:
#!/bin/bash
cd /usr/local/scripts
echo "Dumping DB"
mysqldump -u root -h localhost -pPASSWORD DATABASENAME > MYdb.sql
echo "Dumped"
echo "Putting .sql to IP OF REMOTE FTP HOST"
ncftpput -V -u FTPuname -p FTPpass IPofFtpHOST /directory/on/your/host /usr/local/scripts/MYdb.sql
echo "Done"
echo "Deleting temp .sql"
rm -f /usr/local/scripts/MYdb.sql
echo "Deleted"
Or just to dump a mysql DB use:
mysqldump -u root -h localhost -pPASSWORD DATABASENAME > MYdb.sql
and backup MYdb.sql
__________________
█
█
Please login or register to view this content.
Registration is FREE
●
Please login or register to view this content.
Registration is FREE
█
█
Please login or register to view this content.
Registration is FREE
●
Please login or register to view this content.
Registration is FREE
03-07-2010, 11:27 AM
#
3
(
permalink
)
Re: how to create auto back up function
hno2005
Novice Talker
Posts: 6
Trades:
0
Talkupation:
Quote:
Originally Posted by
lynxus
if you have linux, You can use this with ftpput.
Create a file called backup in /usr/local/scripts/
Insert this:
#!/bin/bash
cd /usr/local/scripts
echo "Dumping DB"
mysqldump -u root -h localhost -pPASSWORD DATABASENAME > MYdb.sql
echo "Dumped"
echo "Putting .sql to IP OF REMOTE FTP HOST"
ncftpput -V -u FTPuname -p FTPpass IPofFtpHOST /directory/on/your/host /usr/local/scripts/MYdb.sql
echo "Done"
echo "Deleting temp .sql"
rm -f /usr/local/scripts/MYdb.sql
echo "Deleted"
Or just to dump a mysql DB use:
mysqldump -u root -h localhost -pPASSWORD DATABASENAME > MYdb.sql
and backup MYdb.sql
thanks for your help but I want to upload a file like backup.php to my root and run it every week
how can i do that ?
thanks
03-07-2010, 11:37 AM
#
4
(
permalink
)
Re: how to create auto back up function
lynxus
Awesomeo-Maximo
Latest Blog Post:
IMsupporting Foresight ( Sneak peek ) – Live...
Posts: 1,618
Location: UK
Trades:
1
Talkupation:
it might just be better to install phpmyadmin and do a dump once a week then.
__________________
█
█
Please login or register to view this content.
Registration is FREE
●
Please login or register to view this content.
Registration is FREE
█
█
Please login or register to view this content.
Registration is FREE
●
Please login or register to view this content.
Registration is FREE
03-10-2010, 06:28 AM
#
5
(
permalink
)
Re: how to create auto back up function
adam89
Experienced Talker
Posts: 41
Name: Adam B
Trades:
0
Talkupation:
Set up a
cron job
to run the file once a week, you need access to the web server though. If not some hosts will add them at request, or provide another method for you to set them up.
Last edited by adam89; 03-10-2010 at
06:29 AM
..
03-10-2010, 11:54 AM
#
6
(
permalink
)
Re: how to create auto back up function
nayes84
Extreme Talker
Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades:
0
Talkupation:
Try using an automatic backup script like this one
http://bash.cyberciti.biz/backup/bac...base-server-2/
then run it using cronjob in daily basis or whatever.
__________________
Please login or register to view this content.
Registration is FREE
|
Please login or register to view this content.
Registration is FREE
|
Please login or register to view this content.
Registration is FREE
if(
I'm
(
"
Helpful"
))
Add_Talkupation
(
"nayes84
"
)
;
« Reply to
how to create auto back up function
Previous Thread
|
Next Thread
Tycoon Talk
>
Web Development and Programming Support
>
PHP Forum
>
how to create auto back up function
Thread Tools
Search this Thread
Show Printable Version
Email this Page
Search this Thread
:
Advanced Search
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
BB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
Off
Pingbacks
are
Off
Refbacks
are
Off
Forum Rules
Feeds:
RSS
JS
XML
Feeds for this forum:
RSS
JS
XML
LinkBack
LinkBack URL
About LinkBacks
Bookmark & Share
Digg this Thread!
Add Thread to del.icio.us
Bookmark in Technorati
Tweet this thread
Page generated in
0.23780
seconds with
12
queries