aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2023-09-12 06:27:27 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2023-09-12 06:28:13 -0500
commite79083ce6568b77ccf6336b6d0f4b312daf70249 (patch)
tree697b610a61c5ad0e6949d6a34456df0b122b9b28
parent065d367504ae3e9b7141f7a7daa6fe1db7aeb4e7 (diff)
downloadrbuild-e79083ce6568b77ccf6336b6d0f4b312daf70249.tar.xz
rbuild-e79083ce6568b77ccf6336b6d0f4b312daf70249.zip
Add systemd and correct cron
-rw-r--r--README.md38
1 files changed, 33 insertions, 5 deletions
diff --git a/README.md b/README.md
index 3d22a5b..cb75387 100644
--- a/README.md
+++ b/README.md
@@ -28,26 +28,54 @@ on my radar, it's taken a backseat since this simpler version fulfills my curren
## How to Use
-To schedule the script to run at 3:00 a.m. on an Ubuntu host, follow these steps:
+### Cron
+
+To schedule the script to run every 30 minutes on an Ubuntu host, follow these steps:
1. Make the script executable:
- ```bash
+ ```
chmod +x rbuild.py
mv rbuild.py /usr/local/bin/
```
2. Open the crontab editor:
- ```bash
+ ```
crontab -e
```
3. Add the following line to run the script every 30 minutes:
- ```cron
- */30 * * * * /usr/local/bin/rbuild.py
```
+ */30 * * * * /usr/local/bin/rbuild.py /path/to/your/compose.yml
+ ```
+
+### systemd
+
+Rebuild the site at 3 AM.
+
+```
+[Unit]
+Description=Rebuild site
+
+[Service]
+ExecStart=/usr/local/bin/rbuild.py /path/to/your/compose.yml --force-rebuild
+```
+
+```
+[Unit]
+Description=Rebuild site at 3AM
+
+[Timer]
+OnBootSec=3min
+# 3AM
+OnCalendar=*-*-* 3:00:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target
+```
### Environment Variables