Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[SOLVED] Autorun page

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
wg
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 88
Joined: Wed Jan 09, 2008 1:23 pm

[SOLVED] Autorun page

  • Quote

Post by wg » Mon Apr 21, 2008 3:26 pm

Hi!
Ok, i made a PHP script wich updates things in MySQL etc.
I asked in a PHP Forum for help to autorun this page so i don't need to run it my self.
In the PHP forum they gave me this thing:
Using Windows - read about schedules
Using Linux - read about cronjobs.
Ofcourse im using Gentoo Linux 2007.0 so i need to use cronjobs.
Im using vixie-cron...
I was wondering is it even possible to run a PHP page from a cron?
If yes - how, for example, every hour?
Last edited by wg on Wed Apr 23, 2008 3:29 pm, edited 1 time in total.
Give me a cookie ^^
Top
db_404
Guru
Guru
Posts: 336
Joined: Thu Dec 05, 2002 2:41 pm

  • Quote

Post by db_404 » Mon Apr 21, 2008 4:49 pm

Well, if the php file is just something you can access directly (i.e. without having to log in, doesn't need anything specific from a browser) you should just be able to do:

Code: Select all

php phpfilename.php
in cron (have a look at the manpage for the format from the crontab and also the options for redirecting any output etc.)

If you have to do something that would require the use of a browser (e.g. have to be logged into a portal before performing some action) then you can always schedule wget via cron to do the execution (but that would require some more work to set up).

I think for most maintenance tasks just running php from the CLI should work for you.
Top
wg
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 88
Joined: Wed Jan 09, 2008 1:23 pm

  • Quote

Post by wg » Mon Apr 21, 2008 7:35 pm

Wierd stuff coming out from php update.php!
Anyway... while i was installing Gentoo i noticed i selected a mirror for stage3 in a text-based browser.
I think it was called 'links'.
Will that work?
Btw, update.php has this:

Code: Select all

for($i = 0; $i < 5000; $i++) {
}
I think this makes it go around and wouldn't quit when its done or something.
Give me a cookie ^^
Top
db_404
Guru
Guru
Posts: 336
Joined: Thu Dec 05, 2002 2:41 pm

  • Quote

Post by db_404 » Wed Apr 23, 2008 1:37 am

wg wrote:Wierd stuff coming out from php update.php!
What was the output?
Anyway... while i was installing Gentoo i noticed i selected a mirror for stage3 in a text-based browser.
I think it was called 'links'.
Will that work?
Maybe - you will also have the program wget installed, have a look at the man page for that. It has better options for command line/scripting control. Links is more of a text based browser to be used by person (although I have used it when I needed html parsing in a script).

Something like:

Code: Select all


wget -q -O - www.foo.com/foo/foo > /dev/null

is probably close to what you need.
Top
wg
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 88
Joined: Wed Jan 09, 2008 1:23 pm

  • Quote

Post by wg » Wed Apr 23, 2008 3:29 pm

Thx, it works!
Give me a cookie ^^
Top
Post Reply

5 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic