# ufw-docker rule ignored

Every time I restarted the container, ufw-docker apparently trashed the rule. This is bad, as if something really bad happened, I don't want my service left inaccessible.

How to fix this? Simple, just put the ufw-docker command into the crontab. Do `sudo crontab -e` , then put the command below to run it every minute.

```plaintext
* * * * * ufw-docker allow traefik 80 && ufw-docker allow traefik 443 2>&1 | systemd-cat -t cron-ufw
```

Then log it using `journalctl -t cron-ufw`:

![](https://cdn.hashnode.com/uploads/covers/66a090e326ea2a8a7954e947/13b3bb4a-aa87-4f52-957f-15fdf04d7315.png align="center")

Done.
