Pass variables to cron'd php

software development

#1

Hi,
at my previous server I could use the following to pass a variable to a php script:
0 12 * * * php -f /home//cronjobs.php rau
(where ‘rau’ is the variable being passed)

but this doesn’t work :frowning:
Can anyone tell me how I should be doing it?

TIA :slight_smile:


#2

I’ve never used Shell to set cron (I’m always worried about breaking it)
Why not try some remote one like http://webcron.org/index.php?lang=en
Hope this helps.


#3

I’m happy using cron, but need someone to confirm for me how to call php files.

Lead Web Dev, carbon360


#4

How are you accessing the parameter in the script?


#5

($argv[1])

Looks like it wasn’t working I wasn’t specifying the php interpreter. (can’t see what’s wrong with the one it finds otherwise)

Lead Web Dev, [b][url=http://carbon-360.com]carbon360[/url][/b]