I have a bash script which utilizes a random function and then runs a file at now plus a random time.
The problem is, that the php file requires a parameter after it eg:
phpfile.php?code=123245b3
When i put in the file including the full path, with the at command, it will run, but not with the parameters.
eg:
randn=2
uniquenum="?code=123245b3"
thefile="/usr/share/sites-enabled/mydomainname.com/phpfile.php"$uniquenum
at -f thefile now + $randn minutes
This spits out a file not found error. But if I remove the $uniquenum variable, it accepts the code, but of course the php file doesnt run correctly.
Even if I hard code the "?code=123245b3", using no variables, it still spits out the file not found error.
How can I get the parameter passed to the file?
I just realised that I need to use php in front of the file to get it to run, but php doesnt accept the parameters either.