Author |
Message |
Ben
Senior WebHelper
Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK
|
Posted:
Fri Jun 14, 2002 6:30 pm (22 years, 6 months ago) |
|
|
|
|
pepitoe
Junior WebHelper
Joined: 21 Jan 2002
Posts: 8
Location: Guernsey, UK
|
Posted:
Sat Jun 15, 2002 5:58 pm (22 years, 6 months ago) |
|
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. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Jun 23, 2002 7:30 am (22 years, 6 months ago) |
|
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 |
|
________________________________
|
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Sat Oct 05, 2002 7:38 pm (22 years, 2 months ago) |
|
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! |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Oct 06, 2002 8:37 am (22 years, 2 months ago) |
|
Why don't you try webcron.org? I can even help you set it up if you want
Actually, the reason why I'm suggesting this is that I tried setting up a "real" cron job a while ago, and failed |
________________________________
|
|
|
|
Ben
Senior WebHelper
Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK
|
Posted:
Wed Oct 16, 2002 8:47 pm (22 years, 2 months ago) |
|
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 |
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Wed Oct 16, 2002 11:08 pm (22 years, 2 months ago) |
|
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. |
|
|
|
|
Ben
Senior WebHelper
Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK
|
Posted:
Wed Oct 16, 2002 11:55 pm (22 years, 2 months ago) |
|
I'll try an get round to it at the weekend.
Ben |
________________________________ Ben Scott
Red and White Kop |
|
|
|
drathbun
WebHelper
Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Sat Mar 01, 2003 10:45 pm (21 years, 10 months ago) |
|
I can shed some light on this topic.
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. 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.
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 |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Mar 02, 2003 7:45 am (21 years, 10 months ago) |
|
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! )? |
________________________________
|
|
|
|
drathbun
WebHelper
Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Tue Mar 04, 2003 3:12 am (21 years, 9 months ago) |
|
"Dave" works just fine.
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! )? |
Sure, take it. Glad to help.
Dave |
________________________________ Dave
Photography Site :: Query Tools Forum :: Weekend Fun |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Mar 04, 2003 3:48 pm (21 years, 9 months ago) |
|
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! )? |
Sure, take it. Glad to help.
Dave |
Hi Dave,
I have now published your tutorial. It is available at http://www.4webhelp.net/tutorials/misc/cron.php. Thanks a lot! |
________________________________
|
|
|
|
drathbun
WebHelper
Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Tue Mar 04, 2003 6:01 pm (21 years, 9 months ago) |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Mar 04, 2003 6:10 pm (21 years, 9 months ago) |
|
We can always do with tutorials . If you have any ideas, just let me know, and I'll tell you if it's appropriate . |
________________________________
|
|
|
|
norm
Junior WebHelper
Joined: 17 Feb 2003
Posts: 20
Location: Oxford, U.K.
|
Posted:
Fri Mar 28, 2003 11:00 am (21 years, 9 months ago) |
|
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
...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. |
|
|
|
|
|