0

I need to execute in one command two php files. the second file need to run right after the first finish. This is what i did, not sure if it's ok:

/usr/bin/wget -O /dev/null -o /dev/null https://example.com/scripts/cron.php; sleep 2; wget -q -O - https://example.com/cron2.php > /dev/null 2>&1

I added sleep between the commands, it will work?

eli99
  • 27
  • 7

1 Answers1

0

You can use && for sequential execution of command,

check https://www.steveroot.co.uk/2010/07/05/cron-multiple/ And What is the purpose of "&&" in a shell command?

In Your case You can try :

01 00 * * * //usr/bin/wget -O /dev/null -o /dev/null https://example.com/scripts/cron.php && wget -q -O - https://example.com/cron2.php > /dev/null 2>&1

Hope these will Help.

Community
  • 1
  • 1
Meera Tank
  • 699
  • 5
  • 13