Skip to content

Commit

Permalink
Enable systemd timer (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
antedebaas authored Aug 31, 2023
1 parent 9e1a5d9 commit b531997
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Setup is pretty easy
4. point your webbrowser to http(s)://[yourhost]/setup and follow instructions
5. after setup add the following command to a schedule of your liking
```sh
php [root path of this project]\bin\console app:checkmailbox
php [root path of this project]/bin/console app:checkmailbox
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down
7 changes: 7 additions & 0 deletions systemd/dmarcmailcheck.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Check mail for new dmarc reports

[Service]
Type=simple
Nice=10
ExecStart=php {PATH}/bin/console app:checkmailbox
9 changes: 9 additions & 0 deletions systemd/dmarcmailcheck.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Check mail for new dmarc reports on schedule

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target
9 changes: 9 additions & 0 deletions systemd/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
echo "Installing systemd service..."
cat $SCRIPT_DIR/dmarcmailcheck.service | sed -e 's@{PATH}@'$SCRIPT_DIR'@g' > /usr/lib/systemd/system/dmarcmailcheck.service
cp $SCRIPT_DIR/dmarcmailcheck.timer /usr/lib/systemd/system/dmarcmailcheck.timer
echo "Reloading systemd daemon..."
systemctl daemon-reload
echo "enable dmarcmailcheck service..."
systemctl enable dmarcmailcheck.timer
18 changes: 18 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
echo "Get latest version from git"
git pull

echo "Install composer dependencies"
composer install

echo "clear cache"
php bin/console cache:clear

echo "run migrations"
php bin/console doctrine:migrations:migrate --no-interaction --query-time

echo "install assets"
php bin/console assets:install public

echo "warmup cache"
php bin/console cache:warmup

0 comments on commit b531997

Please sign in to comment.