Closed DjSni closed 2 years ago
Hello,
i'll give it a look, maybe i can reproduce that bug, looked at my crontab and everything was fine.
Will tell you, when i found the problem!
Greetings
I have the same issue. Right now this leads to multiple threads being started at the same time and some thread conflicts as the databases are locked.
I use CRON_TIME: /15 *
My /etc/crontabs/root file looks like this:
~ # cat /etc/crontabs/root
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 * * * * run-parts /etc/periodic/15min
0 * * * * run-parts /etc/periodic/hourly
0 2 * * * run-parts /etc/periodic/daily
0 3 * * 6 run-parts /etc/periodic/weekly
0 5 1 * * run-parts /etc/periodic/monthly
*/15 * * * * yes | vdirsyncer discover && vdirsyncer metasync && vdirsyncer sync
*/15 * * * * yes | vdirsyncer discover && vdirsyncer metasync && vdirsyncer sync
*/15 * * * * yes | vdirsyncer discover && vdirsyncer metasync && vdirsyncer sync
*/15 * * * * yes | vdirsyncer discover && vdirsyncer metasync && vdirsyncer sync
I looked at the sync.sh script. On startup you are appending (using ">>") to the /etc/crontabs/root file. So every time the container is restarted a new line is appended.
As the container state is persisted upon restarts this leads to the described behavior. Only terminating the container and recreating it afterwards would destroy the state.
I think the easy and sufficient fix is to use ">". This will remove all the default entries in the beginning (with the /etc/periodic/...) setup. But as the subfolders in /etc/periodic/ are empty everything will work correctly.
If you want to do it "by the book" you could make a copy of the vanilla /etc/crontabs/root file in the image, copy it over via sync.sh to /etc/crontabs and then append the line. But in my view this is overkill.
PS: Thanks for this very useful container!
@nifri Thanks for that hint, i didn't find a solution so far, because i always recreate the container^^.
I'll change that and upload a new image.
Will tell you guys, when everythings ready! :)
@DjSni @nifri Problem is solved with release 2.2.1 👍 https://github.com/Bleala/Vdirsyncer-DOCKERIZED/releases/tag/2.2.1
Did it "by the book" as you said, because i was bored and wanted a clean script :D
Hope this solves the problem for you too!
I'll close that issue.
Looking good. I pulled the new image and it works correctly now. Thanks for the speedy fix!
Hi,
good work, but I have a strange error, every time I restart the container the cron entry is rewritten. So my crontab now looks like this:
greetings