Jump to content
MakeWebGames

[site tools] auto backup your site


TheRipper
 Share

Recommended Posts

I had a coder that wrote mine in for me but honestly not sure what all he did.This looks much simpler.I am copying it from a support forum.Not my code but they posted it for free so geuss it is cool.

The following scripts were provided from scanman20.

Site Backup via Cron

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

MySQL backup via cron - Emailed to You

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

MySQL backup via cron - FTPed to You

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Please note that all scripts should be with a .php extension, the file should have 755 permissions, and you would also need to not only change the first few variables to those of your site setup but also add a cron job in Cpanel with a path to the script such as "php /home/username/path-to-the-php-script" (without the "" and replacing path-to-the-php-script with your actual path to it).

It looks as if there were a few bugs for a few people and some not.Most here can figure it out but here is the link to where it is posted at so you can see there qeustions and answers.

http://www.lunarforums.com/forum/index. ... ic=22118.0

I back my site up to my email and to the site and to a extra email every 6 hours.It saved me since my host service did not do what they claimed.

Link to comment
Share on other sites

  • 2 months later...

Re: auto backup your site.

Warning: file(): Unable to access backup-2007-01-17.sql.gz in /usr/local/psa/home/vhosts/blazingpistols.COM/httpdocs/sqlbackup.php on line 20

Warning: file(backup-2007-01-17.sql.gz): failed to open stream: Invalid argument in /usr/local/psa/home/vhosts/blazingpistols.COM/httpdocs/sqlbackup.php on line 20

Warning: implode(): Bad arguments. in /usr/local/psa/home/vhosts/blazingpistols.COM/httpdocs/sqlbackup.php on line 20

Warning: unlink(backup-2007-01-17.sql.gz): No such file or directory in /usr/local/psa/home/vhosts/blazingpistols.COM/httpdocs/sqlbackup.php on line 41

it dont wwork

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 5 months later...
  • 1 month later...

Re: [site tools] auto backup your site

When you Backup your site lol its like every file but you ownly really want public_html lol and maybe ftp and you cant choose an exact folder i made it any ways so it backups my site automatically every week and send it to my email incase i get hacked lol

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

Re: [site tools] auto backup your site

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

which is

$data = chunk_split(base64_encode(implode("", file($filename))));

Everything works except the script doing the mySQL command to create the back-up. I've tried the email, ftp, and cron version. I even tried changing

$command = "mysqldump -u$dbuser --p$dbpwd $dbname > $filename";

to

$command = "mysqldump -uroot -pXXXXXXXX clan > /home/virtual/site1/fst/var/www/html/back-ups/clan-4-16-08.sql";

the exact code I use to manually make back-ups. Does something else need to be done to give permission for the back-up to be made? Files do have 755 permissions.

 

Edit: Duh!!!! Helps to have the directory where the file will be temporarily, be chmod 777!!!!

Link to comment
Share on other sites

  • 4 weeks later...

Re: [site tools] auto backup your site

Take a look at the last part of my post.

chmod 777

Directory with back-up files has to have permission to create the file for it to exist. No permission, there for no such file error!!!

Link to comment
Share on other sites

Guest Anonymous

Re: [site tools] auto backup your site

Well the mysqldump command is only partially useful here...

One particular site I've tested this one for example, the command takes just under 5 seconds to run - fast you say? Not in the slightest. In five seconds several tables could be changed resulting in an inconsistent snapshot of the data.

Now, if you could convert your tables to use a transaction safe database, then no problem. Well, almost no problem. Now there be a slightly longer time delay, however you can get a consistent snapshot.

Okay, so take the site off-line at new-day for 10 seconds, perform the dump - that might work, but I dislike taking anything off-line for a mere backup.

Solutions? Well there are a few stable solutions - and they are not difficult to figure out. Think about what data you need to back up - i.e. what changes often and what doesn't, for the more experienced of you - have a look at clustering.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...