[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Running lynx from cron to run php script



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I want to use cron to run a script like the following.
>
> 01,15,30,45 * * * * root TERM=xterm; export TERM; /usr/bin/lynx
> -dump http://files.fmmetrocog.org/weather/weather.php > /dev/null
> 2>&1
>
> My question is what permissions would be giving to the script?  I
> am having one person tell me that by doing it this way, the php
> script is running with root permission.

It depends what user's crontab holds this command.  If you enter it in 
your own crontab (log into a shell as yourself), and do

crontab -e

it will run with your permissions, etc.

> The php script accesses another site and parses the file for the
> weather info and saves it.

Another option is to add a chmod/chown command for the created file 
(you do know what it's named and where it's put, right?) to the end 
of your cron entry (although, at this point, you may want to write a 
shell script with all these steps and just have your cron job call 
the shell script):

01,15,30,45 * * * * root TERM=xterm; export TERM; /usr/bin/lynx
- -dump http://files.fmmetrocog.org/weather/weather.php > /dev/null
2>&1; chmod 611 file; chown you:yoursite file;

- -- 
Bruce Timberlake

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE99h5xvLA2hUZ9kgwRAmHXAJ9BCf0y79cfYibK9zBpJnhIrl3YzwCdHeM1
io3w467qXoywYq0xH6mk4Pk=
=nQYC
-----END PGP SIGNATURE-----