I want my RaPi to have the right time even it is connected to internet or not. So I bought RTC DS3231 module and installed, works fine. Bu at the same time I want RaPi to syncronize time from internet or the local time server I define.
So for instance, RaPi will try to access to the internet time server or local time server (NTP Server), if it is accessible it will sync it's time with this server and write the same time to RTC. Otherwise it will go on using RTC's current time.
I've worked on timedatectl command, edited /etc/systemd/timesyncd.conf but I could not manage to run these two functions together. If it is needed I can write all these stuff in python to run correctly.