Simplified timer + update install instructions
This commit is contained in:
parent
f8ffd95184
commit
f715107873
|
@ -38,14 +38,11 @@ Enable linger for the bot user (so it starts at boot and keeps running) and inst
|
||||||
sudo loginctl enable-linger nxy
|
sudo loginctl enable-linger nxy
|
||||||
mkdir -p $HOME/.config/systemd/user
|
mkdir -p $HOME/.config/systemd/user
|
||||||
ln -fs $HOME/nxy/files/nxy-bot.service $HOME/.config/systemd/user
|
ln -fs $HOME/nxy/files/nxy-bot.service $HOME/.config/systemd/user
|
||||||
systemctl --user daemon-reload
|
|
||||||
systemctl --user enable --now nxy-bot.service
|
systemctl --user enable --now nxy-bot.service
|
||||||
```
|
```
|
||||||
|
|
||||||
Create directory for database dumps and activate timer:
|
Create directory for database dumps and activate timer:
|
||||||
```sh
|
```sh
|
||||||
mkdir -p $HOME/backups
|
|
||||||
ln -fs $HOME/nxy/files/nxy-db-dump.{timer,service} $HOME/.config/systemd/user
|
ln -fs $HOME/nxy/files/nxy-db-dump.{timer,service} $HOME/.config/systemd/user
|
||||||
systemctl --user daemon-reload
|
|
||||||
systemctl --user enable --now nxy-db-dump.timer
|
systemctl --user enable --now nxy-db-dump.timer
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,5 +3,4 @@ Description=nxy database dump timer
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
WorkingDirectory=/home/nxy/backups
|
ExecStart=/bin/sh -c "/usr/bin/pg_dump -d nxy_prod > dump.sql"
|
||||||
ExecStart=/bin/sh -c "/usr/bin/pg_dump -d nxy_prod > $(date +%Y-%m-%d_%H-%M-%S).sql"
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
Description=nxy database dump timer
|
Description=nxy database dump timer
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
# Time to wait after booting before we run first time
|
|
||||||
OnBootSec=10min
|
OnBootSec=10min
|
||||||
# Time between running each consecutive time
|
|
||||||
OnUnitActiveSec=12h
|
OnUnitActiveSec=12h
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user