Fix cronjob errors of Dovecot expunge
Recently, I discovered that the cronjob on my mailcow-dockerized host isn't working. If the script is called via crontab, the docker-compose command doesn't know where the config file is located. So I added the "cd" to change the directory to the working directory of the mailcow-dockerized instance. When executing the docker-compose exec command via cronjob, it fails with error message "the input device is not a TTY". By adding the parameter "-T" it works.
Dieser Commit ist enthalten in:
Ursprung
60fc58622e
Commit
c1cb6c9e07
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
|
@ -31,8 +31,9 @@ If you want to automate such a task you can create a cron job on your host that
|
|||
|
||||
```
|
||||
#!/bin/bash
|
||||
/usr/local/bin/docker-compose exec dovecot-mailcow doveadm expunge -A mailbox 'Junk' savedbefore 2w
|
||||
/usr/local/bin/docker-compose exec dovecot-mailcow doveadm expunge -A mailbox 'Junk' SEEN not SINCE 12h
|
||||
cd /opt/mailcow-dockerized
|
||||
/usr/local/bin/docker-compose exec -T dovecot-mailcow doveadm expunge -A mailbox 'Junk' savedbefore 2w
|
||||
/usr/local/bin/docker-compose exec -T dovecot-mailcow doveadm expunge -A mailbox 'Junk' SEEN not SINCE 12h
|
||||
[...]
|
||||
```
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren