Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

You have tried to access an archived page. Please go to the new https://root360.atlassian.net/wiki/spaces/KB to find more documents.

...

To set a CRON job in an environment of Composer can be used. Therefore the following configurations must be made:

...

composer.json:

Code Block
languagexmllinenumberstrue
{
…
 "scripts": {
…
 "post-install-cmd": [
…
 "app/bin/post-setup.sh",
…
 ],
 "post-update-cmd": [
…
 "app/bin/post-setup.sh",
…
 ]
 },
…
}
Code Block

app/bin/post-setup.sh:

Code Block
languagebash
linenumberstrue
#!/bin/bash
cd "$(dirname $(readlink -f "${0}") )"
if [ "$SYMFONY_ENV" = "prod" ]; then
 . "${PWD}/_post-setup-prod.sh"
fi
app/bin/_post-setup-prod.sh:
#!/bin/bash
cd "$(dirname $(readlink -f "${0}") )/../../"
…
crontab conf/crontab/crontab-prod
…
Code Block

conf/crontab/crontab-prod:

Code Block
languagebashlinenumberstrue
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31) # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat # |  |  |  |  | # *  *  *  *  *  command to be executed
   *  *  *  *  * cronjob-example

...