4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Good backup script
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Ben
Senior WebHelper
Senior WebHelper


Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK

PostPosted: Fri Jun 14, 2002 6:30 pm (21 years, 10 months ago) Reply with QuoteBack to Top

Just found this http://www.phpmybackup.com

Seems very good, just what I'v been needing anyway Smile

________________________________
Ben Scott

Red and White Kop
OfflineView User's ProfileFind all posts by BenSend Personal MessageSend emailVisit Poster's Website
pepitoe
Junior WebHelper
Junior WebHelper


Joined: 21 Jan 2002
Posts: 8
Location: Guernsey, UK

PostPosted: Sat Jun 15, 2002 5:58 pm (21 years, 10 months ago) Reply with QuoteBack to Top

Looks good, but makes me wish Cyberwings had Cron support so I could automate it. I am trying to use webcron.org but I dont know how to translate the command in the docs

Code:
php -q /home/user/public_html/phpmybackup/export.php database_to_export


to a form I can use on webcron, where you only have the option to enter a url like
Code:
http://www.mysite.com/phpmybackup/export.php database_to_edit


which doesnt actually produce a backup when I test it.
OfflineView User's ProfileFind all posts by pepitoeSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Jun 23, 2002 7:30 am (21 years, 10 months ago) Reply with QuoteBack to Top

Maybe you could try
Code:
http://www.mysite.com/phpmybackup/export.php?database_to_edit
You'd have to look at the code to see if it needs to be like this or something:
Code:
http://www.mysite.com/phpmybackup/export.php?db=database_to_edit

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sat Oct 05, 2002 7:38 pm (21 years, 6 months ago) Reply with QuoteBack to Top

Right, could someone give me step by step instructions on using Cron Jobs, what they do in brief, and how to set them up?

As I'm not sure but I wanna automate my backup process using this script.

Cheers!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Oct 06, 2002 8:37 am (21 years, 6 months ago) Reply with QuoteBack to Top

Why don't you try webcron.org? I can even help you set it up if you want Wink

Actually, the reason why I'm suggesting this is that I tried setting up a "real" cron job a while ago, and failed Rolling Eyes

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Ben
Senior WebHelper
Senior WebHelper


Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK

PostPosted: Wed Oct 16, 2002 8:47 pm (21 years, 6 months ago) Reply with QuoteBack to Top

Have you worked it out yet?

If not I'll post some sort of tutorial.. Well suppose I should do one anyway for the tutorial section.

________________________________
Ben Scott

Red and White Kop
OfflineView User's ProfileFind all posts by BenSend Personal MessageSend emailVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Wed Oct 16, 2002 11:08 pm (21 years, 6 months ago) Reply with QuoteBack to Top

Not had chance to try it out yet to be honest, if you could do a kind of tutorial that would be cool and very helpful, got no clue where to start with cron jobs.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Ben
Senior WebHelper
Senior WebHelper


Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK

PostPosted: Wed Oct 16, 2002 11:55 pm (21 years, 6 months ago) Reply with QuoteBack to Top

I'll try an get round to it at the weekend.

Ben

________________________________
Ben Scott

Red and White Kop
OfflineView User's ProfileFind all posts by BenSend Personal MessageSend emailVisit Poster's Website
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Sat Mar 01, 2003 10:45 pm (21 years, 1 month ago) Reply with QuoteBack to Top

I can shed some light on this topic. Smile

cron is a Unix scheduling utility. The syntax is a bit cryptic, but it can be figured out. You'll need to either have telnet (shell) access to your server, or some other way to interface with it. You'll also have to have a host that allows cron jobs to run.

For example, I have the following two entries in my crontab (cron table).
Code:
42 2 * * 0  /usr/bin/zip -q access-log.`/bin/date +\%m\%d`.zip access-log
59 23 * * * /home/server_name/other_path/batch/snapshot.sh

I've changed the names to project the innocent. Wink Reading from left to right, the first few symbols (numbers or *) refer to when a job will run. For example, the second entry in my crontab runs at 23:59 (that's 11:59 pm). Since the next three items are *, it runs on every day on every month, no matter which day of the week it is. The first job zips up the access logs for my web site, ad 2:42 AM, but only on Sunday. It doesn't matter which day of the month it occurs on, it just happens every Sunday.

After that cryptic beginning, the rest of the line is just the command to run. So suppose you wanted something to run on the 15th at noon, but only if it was a Saturday. Then your cron entry would look something like:
Code:
0 12 15 * 6 your_job_here

When cron looks for jobs to run, this job will only run at noon (12:00) on the 15th (15) of any month (*) when that day is a Saturday (6). In other words, not very often. Wink

The five fields, in order, are minute (valid values 0 - 59), hour (valid 0 - 23), day of month (1 - 31), month (1 - 12, or use names), and day (0-7, Sunday is 0 or 7, or use names). Any of these fields can be a *, which means match all values.

I've been using the terms "cron" and "crontab" as if they were the same; they're not. cron is the Unix program that wakes up every minute and looks for jobs to run. crontab is the database or listing of jobs to consider. I don't own my host, so I don't have access to run cron. But I can use the crontab command (-r to remove, -e to edit, or -l to list) to set up cron jobs that will be run on a schedule that I set up. The listing of jobs above was generated with crontab -l.

Because cron runs as root, you should fully qualify your path names to any scripts that will be run.

Hope this helps!

________________________________
Dave
Photography Site :: Query Tools Forum :: Weekend Fun
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Mar 02, 2003 7:45 am (21 years, 1 month ago) Reply with QuoteBack to Top

Hi drathbun,

I'm not sure if Justin/Ben needed this, however it would make the beginning of a good tutorial. Would you be willing to let me take this, make a few changes, and publish it (under your name of course! Smile)?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Tue Mar 04, 2003 3:12 am (21 years, 1 month ago) Reply with QuoteBack to Top

Daniel wrote:
Hi drathbun

"Dave" works just fine. Wink

Quote:
I'm not sure if Justin/Ben needed this, however it would make the beginning of a good tutorial. Would you be willing to let me take this, make a few changes, and publish it (under your name of course! Smile)?

Sure, take it. Glad to help. Cool

Dave

________________________________
Dave
Photography Site :: Query Tools Forum :: Weekend Fun
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Mar 04, 2003 3:48 pm (21 years, 1 month ago) Reply with QuoteBack to Top

drathbun wrote:
Quote:
I'm not sure if Justin/Ben needed this, however it would make the beginning of a good tutorial. Would you be willing to let me take this, make a few changes, and publish it (under your name of course! Smile)?

Sure, take it. Glad to help. Cool

Dave


Hi Dave,

I have now published your tutorial. It is available at http://www.4webhelp.net/tutorials/misc/cron.php. Thanks a lot!

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Tue Mar 04, 2003 6:01 pm (21 years, 1 month ago) Reply with QuoteBack to Top

Daniel wrote:
I have now published your tutorial. It is available at http://www.4webhelp.net/tutorials/misc/cron.php. Thanks a lot!

No prob. Glad to help. Need something else? Smile

Dave

________________________________
Dave
Photography Site :: Query Tools Forum :: Weekend Fun
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Mar 04, 2003 6:10 pm (21 years, 1 month ago) Reply with QuoteBack to Top

Laughing We can always do with tutorials Very Happy. If you have any ideas, just let me know, and I'll tell you if it's appropriate Smile.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
norm
Junior WebHelper
Junior WebHelper


Joined: 17 Feb 2003
Posts: 20
Location: Oxford, U.K.

PostPosted: Fri Mar 28, 2003 11:00 am (21 years ago) Reply with QuoteBack to Top

Hi Guys,

I dunno if anyone is interested but I've updated/patched phpMyBackup to do the following.

If you've used phpMyBackup before you'll know that it can two of the three things e.g. export the database and ftp it to another server but what it can't do is export individual tables from the database and then import the newest version automatically them via the command line (for a cron/batch job). That is why I have modified the original code to do this and more. Please see the "changes" below for more details.

Download it here http://www.normsland.co.uk/phpmybackup/

Cheers,

Norm Very Happy

...Changes...

26/03/2003
-- export.php - fixed a bug with php 4.1.2 and zlib library in the gzopen command. Now opened with "wb9".

25/03/2003
-- import.php - now takes into account drop table sql command.
-- import.php - updated to allow shell import
-- usage: "import.php databasename"
-- shell version of import.php automatically grabs the latest backup in the "export directory" and imports into the destination database.
-- export.php now allows you to backup individual tables
web -- by entering table1,table2,tableetc in the tables box
shell -- usage: "export.php databasename table1,table2,tableetc"

24/03/2003
-- export.lib - added DROP TABLE IF EXISTS line to sql file for easy importing into phpmyadmin and automatic importing using import.php.
-- Fixes problems when importing backups when database table already exists.
OfflineView User's ProfileFind all posts by normSend Personal MessageVisit Poster's WebsiteMSN MessengerICQ Number
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   


Go to page 1, 2  Next

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.309136 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme